This is going to be a stupid question but I have spent an inordinate amount of time trying to remove the AJAX part from the jQuery validation plugin function below but still have the validation work. Suffice to say I haven’t succeeded.
$(document).ready(function(){
$("#myform").validate({
debug: false,
rules: {
group: {required: true},
},
messages: {
group: {required: " Choose a group."},
},
submitHandler: function(form) {
$('#results').html('Loading...');
$.post('', $("#myform").serialize(), function(data) {
$('#results').html(data);
});
}
});
});
So yeah, I’m dumb. Can anyone help me out?
When you send the object back, send it as a JSON object.
Here’s an example where we’re going to use the serialized elements, conditionalize some data, and then send something back with our new page.
Then in the validator, we can parse
data.locto thewindow.locationto mimic the redirect.