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.

which event do I use?

Avatar

Former Community Member
Hi,



In form with several text fields, I have to validate the input in each field, If it fails the validation test, JavaScript error message is displayed, and the focus is set to this same field. This continues till the user enters the correct input.

All this then repeats for the other fields as well.



I have tried running the script in Exit event. However the problem I face here is when a user enter a incorrect input in 1st field, there is a infinite loop of JS error boxes with control moving alternately between 1st and 2nd fields.



Hope I made the issue clear to you all.



So, in which event should I run the script so that the focus is set to same field until the input is incorrect.



Regards.
0 Replies