Form element Required text
Hello,
Is there anyway to change the text from the warning when you put a form element as Required and then Submit the form?
Thanks
-
Hi Ricardo,
To change the default text used for all "required" items:
- With your workflow open in Designer, click Info from the left panel
- Click Translations
- Click Add
- Change the ID to form-element-status-missing and the text to whatever you want
To change the text for an individual form item, use a validation event instead of the "required" checkbox:
- Uncheck "Required"
- Under "Events", click "Add" for validate
- Use an If activity to check whether the value exists, and connect it to Set Form Element Error (with your custom text) and Clear Form Element Error activities.
I've attached an example that shows both, and there's more info on validation events here https://docs.geocortex.com/workflow/latest/help/Default.htm#wf5/help/forms.htm#Validate_the_User%E2%80%99s_Input%3FTocPath%3DForms%7COverview%2520of%2520Forms%7CValidate%2520the%2520User%25E2%2580%2599s%2520Input%7C_____0
0 -
Thanks for the feedback Amanda.?
0 -
Hi Amanda,
I am looking for a way to change the text for an individual form item but I am stuck at configuring the validation event and how to use the If activity to check whether the value exists in combination with the Set Form Element Error. I cannot find the example that you mentioned in your last post. Can you attach it again?
Cheers,
Marina
0 -
You can use a Get Form Element Value activity and e.g. the following check in an If activity.
=$formElementValue1.value.toString().length == 00 -
Thanks for the quick answer, Nico!
In my case the value to be checked comes from a number slider. The validate should check if the value of this slider is not 0. If it is 0 it should come up with the message ‘The value has to be greater than 0’. I hope that I have configurerd it correctly now with the ‘Set Form Element Error’ activity if the ‘If’ statement is true. However, I am not sure what to configure on the other side of the ‘If’ activity. I now used the ‘Propagate Form Event’ activity. Is that correct?
0 -
A Clear Form Element Error activity, see sample File > New > Form - Validate Event.
0 -
Ah great! Thank you!
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
7 Kommentare