Form serialization issue after server-side validation fails in JQuery AjaxForm.Submit()

Form serialization issue after server-side validation fails in JQuery AjaxForm.Submit()

I have a form
  1. <form id="form0" enctype="multipart/form-data" method="post" name="form0">
  2. <input type="text" id="FileField" />
  3. </form>

And the following JavaScript code:

  1. $('#form0').ajaxForm({
  2. url: sourceUrl,
  3. type: 'POST',
  4. data: formdata,
  5. target: '#FileField',
  6. success: function (data) {
  7. if($(data).find('#RouteMidDetails').length >= 0) {
  8. $('#divSearchPopupContent').html(data);
  9. if($('#hdnModelState').val() == 'True') {
  10. DisablePopup();
  11. grid.rebind();
  12. } else if($('#hdnModelState').val() == undefined) {
  13. DisablePopup();
  14. window.location = loginUrl;
  15. }
  16. } else {
  17. window.location = loginUrl;
  18. }
  19. },
  20. error: function (req, textStatus, errorThrown) {
  21. window.location = ErrorUrl;
  22. }
  23. }).submit();



The form is basically a partial view (i.e pop-up). When validation is true, the form is serialized properly and is submitted, however, it doesn't serialize the form data after validation fails. #Filefield is a file upload text box. This works perfectly fine in Firefox and Chrome but not in IE9.

Please let me know how to fix this issue.

Many thanks in advance :)