Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 surveying the Monastery: (3)
As of 2015-07-04 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls