in reply to Perl cgi - getting the values from select

The values in a select box are only sent to the server if they are selected, so in general you can't determine the values in a selectbox from a CGI.

You could make the javascript select all values in copy2 on submit (use the onsubmit attribute of the form tag), or you could put the values in a seperate hidden field while you're adding them to the select box. The first option seems easiest.

Joost

  • Comment on Re: Perl cgi - getting the values from select

Replies are listed 'Best First'.
Re^2: Perl cgi - getting the values from select
by bradcathey (Prior) on Aug 07, 2004 at 14:59 UTC
    I concur absolutely with Joost. On submit, grab the values in copy2 and put them in a hidden field would be my take, but both of Joost's suggestion are workable—it's personal style.

    —Brad
    "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton
Re^2: Perl cgi - getting the values from select
by kiat (Vicar) on Aug 08, 2004 at 02:18 UTC
    Thanks, Joost!

    I was wondering of what use is copying the values from one select box to another if you can't get them from the script (because they aren't "selected"). It turns out that you could do that via a hidden field...

    Cheers