From: "Rajeev Prasad" <rp.ne...@yahoo.com>
Hi,

without using CGI.pm how can i collect the values of a multiselect element?

say for e.g.:

< select name="hobbies" id="hobbies" multiple>
<option>Reading Books</option>
<option>Writing Stories</option>
<option>Collecting Coins</option>
<option>Cross Stitching</option>
<option>Tenis</option>
<option>Playing Cricket</option>
< /select>

when the form is submitted, i have to get the selected values in an array. how can i do that?



*if you are curious, (as per my understanding) even though CGI.pm would make it easy to get values out of parameters passed to the script by the web form. I would still have to do validation of values passed seperately. so why should i use a big module just to collect form data? i am using TT to display the form/HTML and javascript to validate input.

**
It depends if the form is submitted using GET or POST and it is much harder because you will need to do aditional work to decode the URL-encoded elements, and you may make errors.

If you don't want to use CGI because is too big, you may want to use CGI::Simple.

It doesn't matter if you validate the data using JS client side. It should be also validated server-side also, but this has nothing to do with the way you get the data from browser.

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to