I think what lostjimmy meant is that the solution is a javascript one, ie. you're going to have to use javascript. A quick and dirty example of how to go about it.
You could of course have a javascript library on your server which was included in each page and provided functions such as that above throughout the site.<html> <head> <script language="javascript"> function getOther(selector,inputID){ var selector=document.getElementById(selector); var inputID=document.getElementById(inputID); if (selector[selector.selectedIndex].value=="Other"){ inputID.style.display= "block"; }else{ inputID.style.display="none"; } } </script> </head> <body> <select id="OSSelection" name = "OS" onchange="getOther('OSSelection', +'OtherOS')"> <option value = "Unix">Unix</option> <option value = "Multics">Multics</option> <option value = "VMS">VMS</option> <option value = "OSX">OSX</option> <option value = "Other">Other</option> </select> <input type="text" name="OtherOS" id="OtherOS" style="display: none;"> </body> </html>
use CGI qw(:standard); ... print start_html({ "-title"=>"A JS Demo", "-script" => { "-src" =>"/scripts/functions.js" } } )
In reply to Re^3: How do I display a textbox only if a certain value is selected from a dropdown list
by Utilitarian
in thread How do I display a textbox only if a certain value is selected from a dropdown list
by wishartz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |