Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

STOP the user until fixes the formatting issue?

Avatar

Level 8

Hello,

(As i am very very beginner to Java SCRIPT, pls. no syntax errors pls pls)

I am allowing the end-user to enter a specific number of characters in field (say, COUNTRY with max. chacratars is 3, like USA), so, i put some validation on VALIDATION PATTERN, working fine, but, say, user entered CANADA.........my form will popup error message, sayong max. is 3 chars only.....then, user pressed OK button on the popup.........and did NOT fixed the issue (user suppose to make CANADA to CAN), skipped and......continued to entering the data in the rest of the fields....but, i want to STOP the user THERE IT SELF!!

UNLESS & UNTIL the user CORRECTS formatting (here max. # of characters) issue, system/form should not let end-user to go further/to enter any data in other fileds/greyed all the REST of the stuff.....User has to fix it to move forward. Pls. let me know  how can i get it?

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

I am not sure I understand your requirements exactly.

If you want to hide all of the other objects in a subform and then test the user input on the exit event. If the user's input does not exceed three characters, then you could show the subform.

Does that sound like a solution?

Niall

View solution in original post

3 Replies

Avatar

Level 10

Hi,

I would be inclined to use a Country dropdown list instead of a free text field. This way you will not need any validation script and the user cannot make the mistake in how you want the data.

If you look in the Custom Library, LC Designer comes with a Countries Dropdown.

Hope that helps,

Niall

Avatar

Level 8

Thank you.

Actually, just for example, i have mentioned as COUNTRY drop down, but, we have our own business drop-downs (say a drop-down like 'How would you like to do correspondence?' the drop down values would be 'Email, Mail, Phone'')

And i can not go with TEXT option, bcz, there are plenty (75) drop-downs and the requirement says it MUST be drop-down

Thank you    

Avatar

Correct answer by
Level 10

Hi,

I am not sure I understand your requirements exactly.

If you want to hide all of the other objects in a subform and then test the user input on the exit event. If the user's input does not exceed three characters, then you could show the subform.

Does that sound like a solution?

Niall