How to use this code (from the demo) if the form isn't created yet:
jQuery("#form").validate({
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
target: "#result"
});
}
});
One way which doesn't work is to call the validation on a on('click',
like this:
$(document.body).on('click', '.submitBtn', function(){
var $form =$('form'+this.id);
$form.validate({
submitHandler: function($form) {
$form.ajaxSubmit({
target: "#result"
});
}
});
});
Any suggestions?