Well I found my problem....

Had nothing to do with CGI.pm. My database structure was different for one
column in two different tables( int(2) , int(3) ) and CGI was looking for a
3digit to match and was only finding a 2digit, so no default was ever
matched to the <option value="nn">.

Also, forcing the default....

print $output->popup_menu(  -name   =>      'manufacturer',
                            -values =>      \%manufacturer,
                            -default=>      $input{mftnum},
                            -force  =>      1,
                            -size   =>      1);

It took another pair of eye (co-worker) to raise the question about the
padded 2digit number.

Hope this may help someone else also.

Thanks,
-Shawn



-----Original Message-----
From: Moon, John [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 11:39 AM
To: 'shawn'; perlcgi
Subject: RE: default named parameter values


So was I ...

I could not find a very good discussing on the topic so maybe someone
else can supply some references but the "answer" is the
"-nosticky" option and pragma ... "use CGI qw/-nosticky/;"

I would guess that the idea was for the CGI user NOT to have to re-reference
a "named" parameter on a responce to a post so you may what to look at the
topic "Setting the value(s) of a named parameter" ... This was not a way I
was "use to thinking" ... I had to get out of my box ...

Hope this helps ...

I'm stuck...

-using CGI.pm

I've created an "edit" cgi-forms-page to edit values/items in a database.
What I want to happen is to have the form fields ( there are several )
populated with the current value that the DB holds for the editing record.
Reason being, I don't want the user to have to fill-out everything again,
especially when they only want/need to change one  value.

The below prints out a text box and fills in the default value with the
original, why? I dunno, I haven't told CGI.pm what the -default=> is...and
yet it puts in the original value.

print $output->textfield(-name=>'title');

but....

When I try the below it never has the default selected  - yes I know that
the below doesn't have -default=> , which I have tried and that doesn't
work. Why would the above have the default and the below not.

print $output->popup_menu(  -name           =>      'status',
                            -values         =>      %status,
                            -size           =>      1);
Thanks,
-Shawn


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to