spires Posted September 3, 2008 Share Posted September 3, 2008 Hi guys I am trying to do a simple onChange="this.form.submit()" Which should refresh the page once one of the options has been selected from a drop down menu. However, it only works if the submit button is not being used. In other words, if I have: <input name="submit" type="submit" value="submit" /> The page refresh does not work. Why is this??? Here is an example of it working, (with out the submit button): http://reviews4mobilephones.com/test.php Here my simple form, with the submit button <?PHP $drop1 = $_POST['drop1']; echo $drop1; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Untitled Document</title> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> </head> <body> <form action="<?PHP $_SERVER['PHP_SELF']; ?>" method="post" name="form1"> <table width="480" border="0" cellspacing="1" cellpadding="0"> <tr> <td colspan="4"><br>Selected <form name="form2" action="<?PHP $_SERVER['PHP_SELF']; ?>" method="post"> <select name="drop1" onChange="this.form.submit()"> <option value="none">------------</option> <option value="Move">Move</option> <option value="Delete">Delete</option> </select> </form> </td> </tr> <tr> <td colspan="4" height="30"> <input name="submit" type="submit" value="submit" /> </td> </tr> </table> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/122567-strange-bug-please-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.