sd9sd Posted July 17, 2008 Share Posted July 17, 2008 Hi, I've got some html for a combobox: <td><form name="form1"><div align="center"> <select name="menu1" onChange="MM_jumpMenu('parent',this,0)"> <option>tag (23)</option> <option>tag (3)</option> <option>By Title</option> <option selected>Show All (92)</option> </select> </div> </form></td> I have a php file which echoes the html file to display it. I'm using this code for the php file to call itself: $path = empty($_SERVER['PATH_INFO'])?$_SERVER['PHP_SELF']:$_SERVER['PATH_INFO']; What I need is that when an option in the combobox is chosen, the option chosen should appear in the addressbar as a query string OR it should be available as a $_POST variable so that my php file should be able to capture it as either $_GET['id'] or $_POST['id'] Currently what's happening is: when an option is selected the php file calls itself, but the option chosen gets added to the address and it gets shown like www.site.com/optionChosen. I don't have a separate function to handle the MM_jumpMenu, but when I choose the option, how can I avoid it appearing in the addressbar and to capture it as a GET or POST? Link to comment https://forums.phpfreaks.com/topic/115179-solved-mm_jumpmenu-and-php/ Share on other sites More sharing options...
sd9sd Posted July 17, 2008 Author Share Posted July 17, 2008 *boing!* Link to comment https://forums.phpfreaks.com/topic/115179-solved-mm_jumpmenu-and-php/#findComment-592301 Share on other sites More sharing options...
sd9sd Posted July 17, 2008 Author Share Posted July 17, 2008 Got it myself...the javascript has to be configured to send a query to php <script language="JavaScript" type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 var tagValue=selObj.options[selObj.selectedIndex].value; var stringCarryingQuery=tagValue.substring(0,tagValue.indexOf(" (")); var outputString=targ+".location='"+"a.php?tagSelection="+stringCarryingQuery+"'"; //document.write(outputString); eval(outputString); //if (restore) selObj.selectedIndex=0; } //--> </script> for <select name="tagSelection" onChange="MM_jumpMenu('self',this,0)">> Link to comment https://forums.phpfreaks.com/topic/115179-solved-mm_jumpmenu-and-php/#findComment-592344 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.