Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Input arrays to CGI

by sedhed (Scribe)
on Jul 24, 2002 at 07:03 UTC ( #184718=note: print w/replies, xml ) Need Help??


in reply to Input arrays to CGI

Looks like you're defining multiple fields with similar names, but CGI.pm does not know that they go together as a group. So, to group certain widgets together for processing, I have used logic like:

<!-- html --> <input name=mylist_1 ... > <input name=mylist_2 ... > <input name=mylist_3 ... >

And then in perl:

@listitems = map(/mylist_(.*)/,$q->param(); # later... $value = $q->param( 'mylist_'.$listitems[3] );

There's probably much prettier ways of doing it. I'd love to hear what others do...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://184718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-01-28 02:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?