FAQs

How to reinitialise validation after custom AJAX field replacement

Written Sep 20, 2018 09:57

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'));

With thanks to healyhatman.

 2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com