MDanz Posted May 7, 2010 Share Posted May 7, 2010 when i click on a submit button it should take me to get.php but it doesn't whats wrong? <form enctype='multipart/form-data' action='' method='POST' name='form'> <div id=$counter><input type='submit' name='webpage' value='Add Webpage' onClick='return changeAction1(this);' /></div> </form> <script type="text/javascript"> function changeAction1(form) { form.action = "get.php" } function changeAction2(form) { form.action = "insert9x.php" } function changeAction3(form) { form.action = "insert8x.php" } </script> Quote Link to comment Share on other sites More sharing options...
F1Fan Posted May 8, 2010 Share Posted May 8, 2010 The problem is that your "this" in the onclick event for the submit button refers to itself, the submit button. You need to change that to "this.form" to refer to the form. 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.