Hi I have a form with the action attribute set to a javascript function (action="javascriptoSomething();"). In my function, after checking that the data was entered properly, I want to submit the form. I use something like this: var frm = document.frm; (my form) if(frm){ frm.action = 'newpage.php'; frm.submit(); } There's nothing wrong with this code except that in chrome, nothing happens after I click the submit button for the first time. The form submits only after the second click. Any ideas why?
dunno - try adding an alert before and after the if (frm) to see if it sets the object or not. to be honest, try accessing it via id - var frm = document.getElementById("myform");