SPUG: cgi method popup_menu

Bill Campbell bill at celestial.com
Tue May 16 13:21:57 CDT 2000


On Tue, May 16, 2000 at 10:14:09AM -0700, Lorraine Johnson wrote:
>Wild...it's true.
>
>In the following code, I have three calls to popup_menu, the third form
>element has the same name as the first.  The third call to popup_menu
>produces a different menu than the first.  When the user clicks the Submit
>button, one expects CGI.pm to only keep the second set.  If I select
>zucchini, pear, and peas, then the result gives me "zucchinipeas" for the
>vegetable result.  I guess you just don't want to use the same name twice
>if you can help it.  (Do you really need the space?)

Lorraine

I haven't tried this, but I have used cgi scripts that return multiple
instances of the same variable name.  These are ancient scripts that date
well before the perl CGI modules so I'm parsing the input myself.  I create
two perl variables for each name on the input, a scalar that contains the
last setting, and an array containing all entries.  I've hacked getopt.pl
to do the same thing with $opt_? and @opt_? which I did originally for a
front-end to groff where multiple -r options are common.

There are places where having an array of variables is useful.

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Systems, Inc.
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

It is necessary for the welfare of society that genius should be
privileged to utter sedition, to blaspheme, to outrage good taste, to
corrupt the youthful mind, and generally to scandalize one's uncles.
                -- George Bernard Shaw

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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