Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: drop down menus with CGI/Perl

by jhourcle (Prior)
on May 22, 2009 at 17:22 UTC ( #765719=note: print w/ replies, xml ) Need Help??


in reply to drop down menus with CGI/Perl

I'd preferably like this drop down menu to not have a submit button either, but to submit as soon as an option is selected from the menu

This part has nothing to do what the server-side language is -- you have to do it in javascript. Attach an onChange event to the select element.


Comment on Re: drop down menus with CGI/Perl
Re^2: drop down menus with CGI/Perl
by Anonymous Monk on Jun 09, 2009 at 12:40 UTC
    Try this code :
    <P>Choose your destination :<BR><BR> <select name="select" onchange="document.location.href=this.options[th +is.selectedIndex].value;"> <option value="http://google.com">optionA</option> <option value="http://yahoo.com">optionB</option> <option value="http://msn.com">optionC</option> </select>
    Regds Vivek
      Try This code, it is using Java Script :
      <P>Choose your destination : <BR><BR> <select name="select" onchange="document.location.href=this.options[th + +is.selectedIndex].value;"> <option value="http://google.com">optionA</option> <option value="http://yahoo.com">optionB</option> <option value="http://msn.com">optionC</option> </select>
      Regds
      Vivek

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://765719]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-07-31 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (255 votes), past polls