Onsubmit I want to fire fancybox popup
I need only to show the fancybox popup once form is VALIDATED (JQUERY Validate used)
It seems to popup the fancybox popup only when the form is not filled in correctly!
http://gloss-hair.com/old/owl/OWLFORM.html
I am not sure how to load the popup fancybox function only once the form is validated:
<script type="text/javascript">
$().ready(function() {
// validate the competition form when it is submitted
$("#ie9_competition").validate({
errorPlacement: function (error, element) {
if ( element.is(":checkbox") ) {
error.appendTo( element.closest('div') );
}
else {
error.insertAfter(element.parent().find("label"));
}
},
rules: {
sEmail: {
required: true,
email: true
},
}
});
});
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox4").fancybox({
'hideOnContentClick': true
});
});
</script>