csckid Posted April 12, 2009 Share Posted April 12, 2009 I tried to use document.getElementById('myform').submit() but it didnt work any help plz Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 12, 2009 Share Posted April 12, 2009 document.forms['formid'].submit() Quote Link to comment Share on other sites More sharing options...
csckid Posted April 12, 2009 Author Share Posted April 12, 2009 that doesnt work too Quote Link to comment Share on other sites More sharing options...
Axeia Posted April 12, 2009 Share Posted April 12, 2009 Does your form actually have the id='myform' attribute set? As a quick way to test if you're actually ending up at the right place you could do a alert( document.getElementById('myform') ); If it comes up with "undefined" then it can't find the form, your syntax itself seems to be correct, above post is just another way to reach the same node. Quote Link to comment Share on other sites More sharing options...
csckid Posted April 12, 2009 Author Share Posted April 12, 2009 alert( document.getElementById('myform') ); returns object well it goes to action page action="thanks.php" but the $_POST doesnt return anything Quote Link to comment Share on other sites More sharing options...
Axeia Posted April 12, 2009 Share Posted April 12, 2009 Then it's not a javascript problem, did you do a "print_r( $_POST );" ? that way you'll know if theres at least something in it. If there isn't anything at all in it we're going to need some more information like a link to the page or the form element including it's content as used on your page. Quote Link to comment Share on other sites More sharing options...
csckid Posted April 13, 2009 Author Share Posted April 13, 2009 I have a new different problem.......... I have a <select> when i select an option, the form submits, but selected option changes.. how can i keep the selected option unchanged even if the form submits i thought this might work header("Cache-control: private"); it didnt Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 13, 2009 Share Posted April 13, 2009 I don't understand. Quote Link to comment Share on other sites More sharing options...
Axeia Posted April 13, 2009 Share Posted April 13, 2009 Me neither, I think you're in over your head with whatever you're trying to achieve. Might want to follow some tutorials before giving it another go. Quote Link to comment Share on other sites More sharing options...
csckid Posted April 13, 2009 Author Share Posted April 13, 2009 well its solved.... i tried the thing in different way thanks for your time Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.