I found this script from a tutorial but I don’t want the validation part, just the posting part.. I tried to delete the validation related commands but it doesn’t work. Maybe I did it wrongly, but my thought is if all of these are needed to run the submitHandler.
Thank you.
$(document).ready(function(){
$("#myform").validate({
debug: false,
rules: {
name: "required",
message: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please let us know who you are.",
email: "A valid email will help us get in touch with you.",
message: "Please write a subject."
},
submitHandler: function(form) {
$.post('mailme.php', $("#myform").serialize(), function(data) {
$('#results').hide().html(data).fadeIn('slow');
});
}
});
});
You don’t want to use the .validate() function then. You probably want to use .post() to submit the form: http://api.jquery.com/jQuery.post/