|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hidden type with drop down menu
I am trying to get a drop down box to GOTO a section in my website. It does not work.
in the <HEAD> <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> in the <BODY> <form name="form1"> <input type="Hidden" name="authorize" value="<?php echo $authorize ?>"> <input type="Hidden" name="a" value="<?php echo $act ?>"> <input type="Hidden" name="id" value="<?php echo $id ?>"> <input type="Hidden" name="i" value="<?php echo $userid ?>"> <select name="select" onChange="MM_jumpMenu('parent',this,0)"> <option value="p.php" selected>Main Menu</option> <option value="pann3.php">Announcements</option> </select> </form> |
|
#2
|
|||
|
|||
|
RE: hidden type with drop down menu
If I am understanding you properly, you want to have a drop-down, that based on the selection would go to a different page. If that is the case, here is some code that will work:
Function for the Header Section: function GoToLink() { FormGoto = document.YOUR_FORM_NAME.SELECT_NAME; SelectedLink = FormGoto.options[FormGoto.selectedIndex].value; Length = FormGoto.length -1; SampleLink = FormGoto.selectedIndex; if (SampleLink == Length) { window.open(SelectedLink) } else { self.location = SelectedLink } } Code for you drop-down select: <select name="SELECT_NAME" onChange="javascript:GoToLink()"> <option value="1STPAGE.PHP">TEXT TO DISPLAY IN DROP-DOWN</option> <option value="2STPAGE.PHP">TEXT TO DISPLAY IN DROP-DOWN</option> </select> If you want to have the first option of the drop-down be a CLICK HERE for option, or something like that, simply leave the option value at "" and it won't do anything. The code would, of course need some minor tweaking for you. Right now, it opens a new window, you could modify that. The only problem I kind of see right now is the hidden values you are trying to pass, which is similar to the problem I had since this is not doing a POST. What you could do is use SESSION to store those values and read them in the next page from the SESSION. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > hidden type with drop down menu |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|