Я использую этот код, чтобы отправить свою форму с помощью ajaxForm PluginСброс формы после запроса Ajax с ajaxForm
$('#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(); } } });
Передать изменение кнопки и сообщение появляется, но форма не сбрасывается. В чем проблема?
Аналогичный вопрос к этому я верю [ссылка] [1] [1]: http://stackoverflow.com/questions/6653556/jquery-javascript- function-to-clear-all-the-fields-of-a-form/ – Valeklosse
http://stackoverflow.com/questions/8981064/jquery-validate-resetform-doesnt-reset-the-onfocus-validation – chepe263