thx Octavian,
 
it looks nice, but not much lighter then CGI.pm. following is the size of 
ubuntu packages. will this be the size in memory once loaded?
 
the data is coming as POST. i am also thinkng to send it as JSON (later).
 
 Download libcgi-simple-perl
Download for all available architectures
Architecture
Package Size
Installed Size
Files
all146.2 kB 460.0 kB [list of files] 
 
 
 
Download libcgi-pm-perl
Download for all available architectures
Architecture
Package Size
Installed Size
Files
all220.1 kB 616.0 kB [list of files] 


________________________________
From: Octavian Rasnita <orasn...@gmail.com>
To: Rajeev Prasad <rp.ne...@yahoo.com>; beginners@perl.org
Sent: Friday, September 30, 2011 12:43 AM
Subject: Re: How to get the multiselect select box or checkbox element values 
WITHOUT using CGI module

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