Forums

How To: Reinitialise validation after custom AJAX field replacement

healyhatman 20 Sep, 2018
When you use a reload event in a field to reload another field, Chronoforms sorts out re-initialising the validation for you. But if for whatever reason you need to use AJAX to replace a field on your own, it loses its validation rules.

Just put the following in your AJAX function AFTER the field is replaced.
         $.G2.forms.initializeFeatures(jQuery('.ui.form'));
$.G2.forms.initializeEvents(jQuery('.ui.form'));
$.G2.forms.initializeForm(jQuery('.ui.form'));

As always - type it out manually, don't copy+paste from the forums.
GreyHead 20 Sep, 2018
Hi healyhatman,

Thank you - now added as a FAQ

Bob
This topic is locked and no more replies can be posted.