Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

empty/wrong field error messages

Avatar

Former Community Member
I have noticed than when designating a certain field in an order form I'm creating to be "User Entered - Required", there are several options that I could choose to be displayed if the user does not fill in the field, or makes a mistake:



Empty Message

Validation Pattern Message

Validation Script Message



What is the difference between these three options and when should I choose to use one over another? Or should I always use all of them?



Also, in doing some initial experiments with these messages, I've found that when I have created a field with one of these messages, and go to preview the document, and purposefully make a mistake in this field, the error/script message does come up. But the problem is that when I press OK on the warning dialog box that comes up, it does not take me back to the field where I made the mistake. I'll press tab again and it takes me to my next field (which makes sense I guess).



Is it possible to "force" the cursor back to the field where a mistake is made so that a user cannot go on without entering the correct information?



Thanks in advance for your help.
3 Replies

Avatar

Former Community Member
Curtis,



For "user entered - required" field, you can add a warning message when user forgets to enter the data in that field. The "Empty message" box is where you type in the message that the user will see when he tabs out of that field without entering any data.



Similarily, when you set a validation pattern for a field, if the the user enter data that does not match the pattern, you can add a warning message by type in the message in the "validation pattern message" box.



You can learn more about this in Designer's Help. Search for "Validating user input" as keyword.

Avatar

Former Community Member
The validation script message allows you to add custom script to perform the validation. Just make sure the script returns a value true or false, so that on the validation script error message is displayed to the user. If you dont return anything, The form thinks that everything was OK when validation occurred



The only way to force someone back to a field that I have found so far is to use xfa.host.setFocus(<FieldObject>); in scripting.

Avatar

Former Community Member
Can someone give me more info on this please

thanks,

k