Does jQuery work with AJAX created elements in a form? -
i've made form of elements added using ajax (post). press button add elements generated php page.
the jquery validation (https://jqueryvalidation.org/) doesn't work on elements have been added using ajax. i've tested page replacing ajax elements regular elements in page , works fine, think it's ajax.
here's jquery:
$("#editeventformnew").validate ( { rules: { artwork: { filesize: 2097152 }, name: { required: true, minlength: 2, maxlength: 50 }, desc: { required: true, minlength: 2, maxlength: 3000 }, venue2: { required: true }, stadate: { required: true, //greaterthan: "datehigherthantoday" }, enddate: { required: true, greaterthan: "#stadate3" }, cutdate: { required: true, lessthan: "#enddate3" }, shodate: { required: true, lessthan: "#stadate3" }, totalsubcat: { minstrict: 0, maxstrict: 4 }, }, messages: { name: "enter event name, longer 2 , less 50 characters", desc: "enter description, longer 2 , less 3000 characters", venue2: "choose venue", stadate: "start must after today", enddate: "end must after start", cutdate: "cut off must before end", shodate: "show must before start", totalsubcat: "choose between 1 , 3 categories" } } );
stadate, enddate, cutdate, shodate created using ajax when button on form pressed. form elements ignored jquery.