Jquery's $(form).submit() Not Firing For Ie Only (mvc3 App)
Solution 1:
I had a similar error. My solution was:
Append the JS form to a div in the DOM, that way IE knows it is there and can submit it.
Hope it helps
Solution 2:
You might be best suited to try using the $.trigger()
function in jQuery.
Invoke it similarly to the way you are calling .submit()
:
$('#' + formId).trigger('submit');
Good luck!
Also
There is a bug in IE where the form will not submit properly if there is no
<inputtype="submit" value="Submit" /> element.
Try adding one and hiding it with CSS.
Solution 3:
You can create an input submit inside the form that you like to send and by Jquery click on the button.
It´s works well with IE.
For example:
<form id="@formId" method="post" enctype="multipart/form-data" action="@Url.Content("/ActivityEvent/SubmitCheckpointApproval")">
<input type="submit" class="HiddenBtn" />
</form>
And the JS:
$(".HiddenBtn").click();
Solution 4:
Can you please tell me that you are directly working with fileupload control or its hidden and you are triggering/invoking it on another button controls? Actually I had same issue. My client wanted that we display a fancy button to work as fileupload control. So we added a button and fileupload control with visibility false and on button click we were triggering the fileupload click event and with the help of jquery we were getting the path of the file and saving it in database. Everything was working perfect in every browser except IE as form was not getting submitted in IE like you explained. After working really hard we find the solution and solution was that we showed the fileupload control and placed it exactly on top the button by setting its position and applied the css opacity :0. So now file upload is not visible because of opacity 0 but when user clicks on the fancy button actually he/she clicks on fileupload as its placed on the top of button. After this solution its working like a charm in every browser. Hope this help you also.
Solution 5:
you need to set type of button/input to submit
as follow:
<button type="submit">Submit</button>
<input type="submit" value="submit">Submit</button>
Post a Comment for "Jquery's $(form).submit() Not Firing For Ie Only (mvc3 App)"