Have problem with fancybox and jquery validate plugin when form is in fancybox container.
For examle (inline): html:
<script>
$(document).ready(function(){ $.fancybox('
<form class="myform">
<input type="text" name="email" class="email" />
<input type="submit" value="submit" name="submit" />
</form>
');
})
</script>
js file:
$(".myform").validate(
{
rules: {
email: "required",
email: "email"
}
}
);
How to make jquery validation pluging to work in fancybox?
.validate()
after theform
is created.beforeShow
callbackbeforeShow
will work. Theform
must be constructed before.validate()
is called.afterLoad
is more appropriate.beforeShow
works pretty much fine to me jsfiddle.net/ZMEEW/1