Reply To: Re-Initiate script

Home Forums Jquery Validation for Contact Form 7 Re-Initiate script Reply To: Re-Initiate script

#5248
Dinesh
Keymaster

Hi Rick,

Ya, you are right loading the form via ajax need the re-initiation.

Since we don’t have proper function for this, you can use this code to

// VALIDATION CODES
jQuery(document).ready(function(){	
	jQuery('.wpcf7-validates-as-required').addClass('required');
	jQuery('.wpcf7-email').addClass('email');
	
	jQuery('form.wpcf7-form').each(function(){
		jQuery(this).validate();
		jQuery(this).addClass(jvcf7_invalid_field_design);
		jQuery(this).addClass(jvcf7_show_label_error);
	});	
});

Hope this helps.

Thanks