I try to write inline javascript for visa state checking
This is my code
javascript:document.getElementById("txtRefNO").value="xxxxxxxxxxxxxxxxxxxxx";document.getElementById("txtDat").value="dd";document.getElementById("txtMont").value="mm";document.getElementById("txtYea").value="yyyy";setTimeout('document.getElementById("form1").submit()',5000);void(0);
This script fill filds and jast reload page. But when i click on submit button it’s ok.
What the difference between clicking and submit() calling?
To answer the What the difference between clicking and submit() calling?, in this case when you click the button, the form submits with an extra parameter
cmdSubmitwith the valueSubmit– this is the submit button and the text you see on it. The server side component for this page may very well be looking for this parameter in order to validate the submitted form (perhaps not the best approach).Try this instead – note that I’ve changed it from a call to
submit()on the form to aclick()on the submit button