Hi I need submit a page after some validation is done. I never used jQuery before, any idea how to do it?
Script come from this tutorial http://webcloud.se/log/Form-validation-with-jQuery-from-scratch/
<form method="post" action="/contact-process" id="demo-form">
<script>
var demoForm = $("#demo-form");
demoForm.validation();
demoForm.submit(function (e) {
$("#valid-form").remove();
if (demoForm.validate()) {
demoForm.append("<strong id='valid-form'>Form is valid!</strong>");
// Here submit the page
}
e.preventDefault();
});
</script>
Change your handler to only prevent default if the form is invalid: