Not able to submit form in chrome through javascript

Form submission is working good on both IE and Firefox, but recently i tested my application on chrome. In that i found chrome is not submitting form, there are no error messages in chrome console, can u help me. i had gone through server answers , still i didn't get proper solution. here is my js code

<script type="text/javascript">

 function callModule(){
     document.frmcheckUserDomain.submit();
}

</script>

<form name="frmcheckUserDomain" action="checkUserDomain.do" method="post">

// here is my form fields

 <input type="button" name="subBtn" value="Submit" onClick="callModule();" />
</form>

Answers


Try changing your callModule method to this...

 function callModule(){
     document.getElementById("frmcheckUserDomain").submit();
}

Also, you will want to give your form tag an id attribute...

You could also access the form via index as well...

 function callModule() {
     document.forms[0].submit();
}

first of all why don't you use input submit button instead, like:

<input type="submit" name="subBtn" value="Submit" />

and if you have some stuff to do when the form gets submitted, you can use onsubmit event in your form.

And for your solution, you can pass it as an argument and then submit it:

<input type="button" name="subBtn" value="Submit" onClick="callModule(this);" />

your function:

function callModule(elm){
    elm.parentNode.submit();
}

see, your code is working fine in my Google chrome. i think u have some issues with your browser or better u check the java Servlet configuration.


Need Your Help

PNG files no longer working with Adaptive-Images

php image .htaccess png adaptive-design

I have somehow run into a problem with my use of Adaptive Images. (http://adaptive-images.com)

How to suppress compiler warnings en masse in Xcode

iphone cocoa xcode gcc llvm

Within several projects, I am using 3rd party code that produce more than a few compiler warnings. I obviously do not want to go through and modify code of actively updated 3rd party projects.