In a rather complex form I enable/disable, enable/disable validation based on the values of a couple of checkboxes.
I set one field (a textarea) as Required and validation Disabled.
I add an event to a checkbox that enables validation using as identifier a class. I added the class in the Container class property of the field (the textarea).
When I check the checkbox nothing happens, the validation is not applied.
I checked the js code that cf adds to the form, in particular the following lines:
The line that I marked in blue is never run.
If I understand correctly the code, the validation rules are searched for in the container, not in the textarea.
Is that correct?
maxx
I set one field (a textarea) as Required and validation Disabled.
I add an event to a checkbox that enables validation using as identifier a class. I added the class in the Container class property of the field (the textarea).
When I check the checkbox nothing happens, the validation is not applied.
I checked the js code that cf adds to the form, in particular the following lines:
if(jQuery.inArray('enable_validation', event.action) > -1){
if(event_target_one.data('validationrules')){
var vrules = event_target_one.data('validationrules'); //*** this line never runs
vrules['disabled'] = 0;
event_target_one.data('validationrules', vrules);
$.G2.forms.initializeForm(Form);
}
}
The line that I marked in blue is never run.
If I understand correctly the code, the validation rules are searched for in the container, not in the textarea.
Is that correct?
maxx