Doctor Who has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I am having a lot of trouble passing a value thru cgi. A dropdown list is being populated by values obtained from a database - the dropdown displays the values fine in HTML however when one is selected and passed (e.g. submit button is clicked) i am unable to access the value on the subsequent html page thru the normal way (e.g. $FORMNAME{'valuename'}) this method works fine for dropdowns that have pre-assigned values in HTML but not when the values come from a database! What am i doing wrong? awaiting your wisdom to be bestowed, the doctor

Replies are listed 'Best First'.
Re: web dev problem
by davorg (Chancellor) on Aug 19, 2002 at 09:39 UTC

    I think that you need to show more of the code. Specifically the bits that create the dropdown list and the bits that interpret the CGI parameters.

    And here's a tip. $FORMNAME{'valuename'} is not the "normal way" to access CGI values. If anything, it points to a potentially broken CGI parameter parser.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: web dev problem
by fruiture (Curate) on Aug 19, 2002 at 09:36 UTC
    ... i am unable to access the value on the subsequent html page thru the normal way (e.g. $FORMNAME{'valuename'})...

    The "normal way" is a good description. Whenever I see something like $UPPERCASE_HASH{formfield} there's an alert shouting from deep in my head: "use CGI;#!!!". Please, use the CGI module whenever you use the CGI, CGI without CGI.pm is in 99% of all cases determined to cause nasty problems.

    How does your HTML look in detail and does it follow these guidelines?

    --
    http://fruiture.de
Re: web dev problem
by Aristotle (Chancellor) on Aug 19, 2002 at 10:06 UTC
Re: web dev problem
by gloryhack (Deacon) on Aug 19, 2002 at 20:51 UTC
    I'll betcha a dollar that the HTML you're generating is non-standard. Check out your HTML-ification code, and view the output as source, rather than rendered, HTML.