Re: Drop Down Menu

From: Date: Sat, 28 Jul 2001 22:30:55 +0000
Subject: Re: Drop Down Menu
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60081@lists.php.net to get a copy of this message
You need to do something like this: With a little PHP work you can make the menu content and url links data driven. <HTML> <HEAD> <TITLE>Page Title</TITLE> <SCRIPT LANGUAGE = "JavaScript"><!--- //hide script from old browsers function MakeArray()
        {
        this.length = MakeArray.arguments.length
        for (var i = 0; i< this.length; i++)
        this[i+1] = MakeArray.arguments[i]
        }
var url = new MakeArray("pg0.htm", "pg1.htm", "pg2.htm", "pg3.htm"); function jumpPage(form)
       {
        i = form.SelectMenu.selectedIndex;
        if (i == 0) return;
        window.location.href = url[i+1];
        }
//end hiding contents ---> </SCRIPT> </HEAD> <BODY BGCOLOR=WHITE> <TABLE BGCOLOR="#D0D0D0" BORDER=0 CELLSPACING=0 CELLPADDING=5 BORDERCOLOR=WHITE WIDTH=100%> <TR><TD> <FORM ACTION="" METHOD=POST> <TABLE BORDER=0> <TR><TD><FONT FACE="Verdana, Arial, Helvetica, San-Serif" SIZE="+1"> <B> &#160;Menu Options &#160; </B></FONT></TD></TR></TABLE> <FONT FACE="Verdana, Arial, Helvetica, San-Serif" ><B> <A HREF="pg0.htm">Back</A> &#160; &#160; <SELECT NAME=SelectMenu onchange="jumpPage(this.form)"> <OPTION SELECTED>Select Section &#160; &#160; &#160; &#160; &#160; <OPTION>Page 1 <OPTION>Page 2 <OPTION>Page 3 </SELECT>
           </FORM>
</TD><TD ALIGN=RIGHT VALIGN=TOP> <FONT SIZE=-2 FACE=Sans-serif>2/1/2001</FONT></TD></TR></TABLE> </BODY> </HTML>
I have the following question : if i make a selection in the drop down menu and click on submit button then the color will send to form2.php I want not click on the submit button i make a selection in the drop down menu then the color will send automatic to form2.php, how can I do this <form method="POST" action="form2.php">
      <td><select size="1" name="color">
          <option>blue</option>
          <option>licht</option>
          <option>red</option>
          <option>yellow</option>
        </select></td>
<input type="submit" value="Next" name="Go"> </form> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Michael Seely 408-777-9949

« previous php.general (#60081) next »