Hi!
I am new to using the tool and I want to know how I can change the background or the letters of a text field to red in a form. When the text field has an incorrect value.
Where can I put this code, in the header, in the validations?
Example:
Discussion posts and replies are publicly visible
Hi mariateresal0001,
You can give the text in the validation part of the text field. Below link provides a sample of how to validate and show the message in the field. Note that adding validation to a field, will only show the text in red color and we cannot change the background.
https://docs.appian.com/suite/help/21.2/recipe-add-multiple-validation-rules-to-one-component.html
Hi Maria,
As Selvakumar mentioned you can not achieve that with the default text field validation, however you you can 'fake' it with a card layout.
Simply put a richTextField inside a card layout, and you'll be able to customise the colours.
a!cardLayout( style: "#e74c3c", contents: a!richTextDisplayField( align: "CENTER", value: "This is some text" ) )
Hope that helps
Acacio B
Thanks a lot, Selvakumar
The form will already be pre-filled for the user, if information is missing in any text field, a message should be displayed requesting its filling immediately, not when submitting
If that's the case, then you can try using the card layout suggested by Acacio. If the value is null for the field, you can show the card layout with information.
Thank you very much, Acacio
Check the card layout. The code creates the following image
I put it in the text field validation but it doesn't work.
if (isnull(ri!codigo_cliente),
a!cardLayout(
contents: a!richTextDisplayField(
value: "Debe ingresar el codigo del cliente",
align: "LEFT"
),
style: "#e74c3c"
), null)
Thank you, Selvakumar
I put it in the text field validation but it doesn't work. The effect must be reflected within the text field.
Please, Can you tell me how to do it?
Hey Maria,
You should not add the cardlayout in the validation of the textfield, you can leave the validation of the text field triggers but without message, than add the cardlayout as a new component below the text field, you can add the same condition in the show when of the cardlayout so it will only be displayed when the date is missing.
Regards,
I will apply your suggestion !!!