I'm using this code to send my form using ajaxForm plugin
$('#donations').ajaxForm({ dataType: 'json', beforeSubmit: function(){ $('#message').html(''); $('#submit').css('color', 'red').attr("disabled", true); }, success: function(response) { if (response.status == 'success'){ $('#donations').resetForm(); $('#submit').css('color', 'white').removeAttr("disabled"); $('#message').html(response.text).delay(5000).fadeOut(); } else { $('#submit').css('color', 'white').removeAttr("disabled"); $('#message').html(response.text).delay(5000).fadeOut(); } } });
The submit button change and the message appear but the form don't reset. What's the problem?