I know this is a very common (and basic) question, however I’ve tried without success.
I have a basic form and I’m using bValidator (jQuery):
<form id="contactform" method="post">
<input type="text" id="nom" name="nom" data-bvalidator="required" />
<input type="text" id="courriel" name="courriel" data-bvalidator="email,required" />
<textarea name="message" id="message" cols="30" rows="4" data-bvalidator="minlength[20],required"></textarea>
<input type="image" src="images/send_btn.png" id="sendform" />
</form>
and I’m trying to send the $.ajax() after validation and it just doesn’t work…
$(document).ready(function () {
$('#contactform').bValidator();
});
$('#sendform').click(function() {
$.ajax({ (----process.php---!!!!) });
}
I know this is not the right way to do it…
Thaks in advance
You’re looking for jQuery.serialize. The docs have examples that guide you further.
Basically, it works like