wierd way to get chrome, IE 8 and firefox to submit the same form
This is the only way I found to get all three browsers to submit the form
without problems. Is there an obvious reason why this is so? A more
elegant solution to this? I'm using Jquery 1.9. Chrome is the odd man out
here, as the code in the else is sufficient to submit via IE and firefox.
Any help from the community is much appreicated.
function submitFormByPost(actionName){
$("#eventAction").val(actionName);
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') >
-1;
if(is_chrome){
document.getElementById('myForm').method='POST';
document.getElementById('myForm').submit();
}
else{
document.forms[0].method='POST';
document.forms[0].submit();
}
}
No comments:
Post a Comment