SPUG: cgi method popup_menu
Lorraine Johnson
lorraine at nw.saic.com
Thu May 18 11:08:36 CDT 2000
Howdy,
I've been experimenting and reading a bit and I think I know what the
problem is. The popup_menu method (and the other form elements) don't make
assignments to the CGI query object, they just put together the html to
write out.
Once the user clicks the submit button, the browser encodes the form
results which are parsed by CGI.pm. If I am following the method call path
correctly (new, init, parse_params, add_parameter?), the choices are added
to the parameter list with a push, not an assignment. So, naturally, if
you have a second form element with the same name, you get the union of
both lists.
The -override attribute of the popup_menu method doesn't reset the
parameters (since it's not an assignment method). Normally, on a
re-display of the form element, any user selection is displayed. The
-override attribute ensures that the default is displayed, instead. (See
Stein, "Official Guide to Programming with CGI.pm," pp 246-7.)
Hope this helps,
Lorraine
...................................
J. Lorraine Johnson
SAIC/Sea Technology
lorraine at nw.saic.com
v: (425) 482-3316
f: (425) 485-5566
http://www.nw.saic.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
For Subscriptions, Email to majordomo at pm.org: ACTION spug-list EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email address
More information about the spug-list
mailing list