mudge/jquery_example — Issue #10: ajax function on submit button click
Author: jpwdesigns
Created: 2012-02-10 17:38:51+00:00
State: open

This may be more a question than anything but, on a form using an ajax function like this for example:

$(document).ready(function() {
$('input[name$="demo_submit"]').click(function() {
var dataString = $('#demo_form').serialize();
$.ajax({
type: "POST",
url: "/ajax/somescript.php",
data: dataString,
success: function(data) {
alert (data);return false;
}
});
return false;
});
});

It seems that the default values are not being cleared and therefore are being posted via ajax. How can I ensure that the default values get cleared by .example?