Yeah, you're right, the solution you want is JavaScript. Below is a really crude example (for a better one, go here):
<HTML> <HEAD> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function showIt(){alert('hello');} function alterFoob2(){ var theLength = document.forms[0].elements[1].length; document.forms[0].elements[1].options[theLength] = new Optio +n('NewThing', 'NewThing');} //--> </SCRIPT> </HEAD> <BODY> <form name="mainform"> <select name="foob" onChange="alterFoob2()"> <option name="1" />Hi <option name="2" />There </select> <select name="otherfoob"> <option name="3">You <option name="4">Foob </select> </form> </BODY> </HTML>

The problem with the above is it gets 'too' static. For example, if you need to use different options in your lists you will have to either change your script code (yuck) or, better, try using the CGI module (see the perldoc and scroll down a lot until you get to the JAVASCRIPT section!)

Update: For those who think the above was a dumb question (and that people like me are idiots for assisting), I'll direct you to the 3rd State of the Onion:  But in my defense, allow me to point out that I'm running the animation by piping commands to RasMol from a Perl script. And that's as it should be. We don't have to do everything with Perl. We just have to be in control.

Celebrate Intellectual Diversity


In reply to Re: Dynamic content w/o refresh by InfiniteSilence
in thread Dynamic content w/o refresh by wackattack

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.