Hey thanks. I had tried that initially but it did not work. I must have had something else wrong as well, it is working now.
Thanks again. CC ----- Original Message ----- From: "Curtis Poe" <[EMAIL PROTECTED]> To: "Chuck" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, October 12, 2001 3:36 PM Subject: Re: Getting data from multiple check boxes > --- Chuck <[EMAIL PROTECTED]> wrote: > > > > How to a grab data from a multiple checkbox type scenario. > > > > Ex: > > > > Say I have: > > <INPUT type=checkbox name=x value=1> > > <INPUT type=checkbox name=x value=2> > > <INPUT type=checkbox name=x value=3> > > > > I then do this: (use CGI.pm for this example) > > > > my $selections = $q->param("x"); > > print "$selections<BR>\n"; > > > > It only prints the last checkbox check, not all of the checked boxes. Is > > there a trick around this? > > > > Thanks, > > CC > > Use an array and not a scalar. > > my @selections = $q->param("x"); > > CGI.pm uses 'wantarray' in its code to figure out what you want. If you use a scalar, it will > return the first value. Use an array and it will return all of them. > > Cheers, > Curtis "Ovid" Poe > > ===== > Senior Programmer > Onsite! Technology (http://www.onsitetech.com/) > "Ovid" on http://www.perlmonks.org/ > > __________________________________________________ > Do You Yahoo!? > Make a great connection at Yahoo! Personals. > http://personals.yahoo.com > > -- > 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]