jquery forms file upload: why do field values reset?
I have a form with some elements like:
<input type="text" name="maxResultsPlain"
id="maxResultsPlain" class="number" value="10">
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 validati开发者_Python百科on plugin, so I suspect that the issue is there.
Central spot in the code:
$("#query-upload").validate({
submitHandler: function(form) {
$(form).ajaxSubmit(submitOptions);
}
});
There are resetForm and clearForm options that you can try and set to false to see if that will help.
精彩评论