Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Validation running twice

Avatar

Level 4
Hi all,



To set my problem into context, this is the order of events:



-Choose an option, makes field visible

-Fill field in with data

-Press button which:

-Checks which fields should be mandatory, and makes them so

-Runs execValidate()

-Hides parent subform and makes next parent subform visible

-Go back to previous parent subform

-Delete data from field

-Press button which:

-Checks which fields should be mandatory, and makes them so

-Runs execValidate()

-Doesn't change subform



However, the second time around it is running the validation script twice and displaying my message "The field XXX is mandatory and has not been completed" twice.



Any ideas why this is hapenning?



Many thanks,



Tom
3 Replies

Avatar

Former Community Member
Are you invoking the execValidate on the individual field or on the subform that contains the field or on the entire form? These types of things are difficult unless we can see the context that things are running in. If you post your form to livecycle8@gmail.com I can have a look and see if there is something I can see that would be causing this.

Avatar

Level 4
I'm invoking it on the subform that is visible, so one step down from the entire form.



Will send it in about 5 mins.



You're still a star as always Paul :)



Tom