hi,

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.

<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>
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.
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.