![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re: multiple values and CGI.pmby modred (Pilgrim) |
on Mar 22, 2001 at 17:58 UTC ( #66329=note: print w/replies, xml ) | Need Help?? |
The problem you are having may be with the call to textfield('name').
When you use CGI.pm's functions to print out form elements they exhibit a certain stickiness. That is, if you already have elements that have been passed in as parameters to the script then CGI.pm will, by default, print out the passed in value. If you want to give it another value than the one that was originally passed in, you need to either pass it an explicit value and the -override=>1 argument or use something like $query->param('foo',"I'm taking over this value!");. Both of the above methods are described under the section "Creating a Text Field" in the text obtained by doing a perldoc CGI. So, in your above example, you are making two calls to textfield('name'). Textfield appears to only take a scalar argument, so only the first element of the array is used in both cases. CGI.pm does not remember if it has printed the element before or not.
In Section
Seekers of Perl Wisdom
|
|