I have a form with some elements like:
The form includes one input of type 'file'. The whole business is wired up to a REST server via `$(form).ajaxSubmit(submitOptions)`, invoked from the submitHandler of the validate plugin, http://bassistance.de/jquery-plugins/jquery-plugin-validation/.
Whenever I submit, the form input fields go back to their default values as per the `value` attribute. Is there a way to prevent this?
A Chrome DOM breakpoint suggests that this is happening as a result of the machinations of the validation plugin, so I suspect that the issue is there.
Central spot in the code:
$("#query-upload").validate({
submitHandler: function(form) {
$(form).ajaxSubmit(submitOptions);
}
});
以上就是jquery forms file upload: why do field values reset?的详细内容,更多请关注web前端其它相关文章!