Dynamic form validation problem using jquery.validate.js and jquery.metadata.js files
I have a form which is being generated based on a country selection by user. For every country there are some dynamic address format fields which I append into HTML using jQuery get call.
Problem:
Validation works perfect for the first loaded form but when I
change the country and a new form is loaded then the validation does not get applied on the dynamically generated fields whereas it gets applied on the fields which are static on the page.
I am using
$ and
Jquery for
validation and jquery
form load, this is causing me the problem.
I am using [
jquery.validate.js/also tried jquery.validate.min.js and jquery.metadata.js] for validating by the class name, dynamic error message also mentioned in the class as below.
class="{required:true, messages:{required:'<?php echo $address_error; ?>'}}" Error: c.data(a.form, "validator") is undefined
Source File:
jquery.validate.min.jsLine: 40
Error: $.data(element.form, "validator") is undefined
Source File:
jquery.validate.jsLine: 822
kindly help me in completing this. thanks in advance.
Bala sundar.