Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-02 Thread Rajeev Prasad
can not say no to you.

i am using CGI::Simple now.

i will be moving over to mod_perl later.



- Original Message -
From: Randal L. Schwartz mer...@stonehenge.com
To: Rajeev Prasad rp.ne...@yahoo.com
Cc: beginners@perl.org beginners@perl.org
Sent: Saturday, October 1, 2011 7:06 AM
Subject: Re: How to get the multiselect select box or checkbox element values 
WITHOUT using CGI module

 Rajeev == Rajeev Prasad rp.ne...@yahoo.com writes:

Rajeev I thought it would be overkill (RAM, CPU etc.) to use CGI.pm
Rajeev when all i need is to get values out of form-variables.  but i
Rajeev am going to settle for CGI::Simple

CGI.pm is optimized though with it's own version of the lazy loader.

If you're already forking for CGI, then the trivial time it takes to
load CGI.pm compared to forking shouldn't concern you.  If you're
looking for performance, you're already using mod_perl, and therefore
you're loading CGI.pm once for thousands of hits.

Either way, I haven't heard a valid reason from you yet.  Just use CGI.pm.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion


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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Rajeev Prasad
Randal,
I thought it would be overkill (RAM, CPU etc.) to use CGI.pm when all i need is 
to get values out of form-variables.
but i am going to settle for CGI::Simple




- Original Message -
From: Randal L. Schwartz mer...@stonehenge.com
To: beginners@perl.org; Rajeev Prasad rp.ne...@yahoo.com
Cc: 
Sent: Friday, September 30, 2011 10:50 PM
Subject: Re: How to get the multiselect select box or checkbox element values 
WITHOUT using CGI module

 Rajeev == Rajeev Prasad rp.ne...@yahoo.com writes:

Rajeev without using CGI.pm

Whenever someone says without $BEST_WAY_TO_DO_IT, I'm seriously
motivated to say why not?  what is the restriction?.

So, why not?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion

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

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Peter Scott
On Sat, 01 Oct 2011 01:00:47 -0700, Rajeev Prasad wrote:
 I thought it would be overkill (RAM, CPU etc.) to use CGI.pm when all i
 need is to get values out of form-variables. but i am going to settle
 for CGI::Simple

Do you have any figures on how the trivial use of RAM/CPU by CGI.pm 
impacts your application noticeably?  Because programmer time is, in the 
absence of proof of anything else, the most precious resource, and so 
anything that takes longer than typing

use CGI;

is overkill.  Especially if it requires downloading something not in core.

-- 
Peter Scott
http://www.perlmedic.com/ http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274
http://www.oreillyschool.com/certificates/perl-programming.php

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Randal L. Schwartz
 Rajeev == Rajeev Prasad rp.ne...@yahoo.com writes:

Rajeev I thought it would be overkill (RAM, CPU etc.) to use CGI.pm
Rajeev when all i need is to get values out of form-variables.  but i
Rajeev am going to settle for CGI::Simple

CGI.pm is optimized though with it's own version of the lazy loader.

If you're already forking for CGI, then the trivial time it takes to
load CGI.pm compared to forking shouldn't concern you.  If you're
looking for performance, you're already using mod_perl, and therefore
you're loading CGI.pm once for thousands of hits.

Either way, I haven't heard a valid reason from you yet.  Just use CGI.pm.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread shawn wilson
On Sep 30, 2011 12:59 PM, Rob Dixon rob.di...@gmx.com wrote:

 On 30/09/2011 12:26, Shawn Wilson wrote:


 You validate data with js? Are you f*g crazy? So, you think that

 if I want to hand you bad data I'm actually going to use your form to do
it?


 On the contrary, I think you are missing a few brain cells yourself
 Shawn. Your friends at work may tolerate such obnoxious and juvenile
 language, otherwise they wouldn't be your friends, but the members of
 this list have a far higher price to pay to separate themselves from
 your froth.


Heh, the language actually had exactly the effect I was hoping. Your chances
of remembering this exchange are much higher now than if I would have just
said please don't do this, its not very wise.

Here's the point - some of you all are accomplished developers and some have
a chance of getting there. You might be involved in a making an awesome
service one day. I might even use a service you design one day. I don't have
the time or energy to audit the public facing code for all the services I
use. I trust that you're smart enough not to do stupid crap (or I don't use
your service).

Since this possibility of me giving you more of my information than I give
most people is real, I felt to compelled to make my point as provocative as
possible (plus it was early and the thought of doing client side validation
really annoyed me).

Also, the completely valid point was made that the validation wouldn't
effect browsers that don't support js. This generally a moot point since 99%
of the rest of a site won't work without js anyway.

Either way, only use client side validation for client things. Don't trust
anything done by or on behalf of the client on the server.

Was that clean enough for you.

Ps, I don't remember reading anywhere that insanities were not allowed?
Iirc, the only mention of language was that this list is an English speaking
list.


Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Brandon McCaig
Shawn:

On Sat, Oct 1, 2011 at 4:50 PM, shawn wilson ag4ve...@gmail.com wrote:
 Also, the completely valid point was made that the validation
 wouldn't effect browsers that don't support js. This generally
 a moot point since 99% of the rest of a site won't work without
 js anyway.

That is only true of poorly coded Web sites. :) Which admittedly
is most Web sites, but I digress. I use Firefox's NoScript
extension, blocking EVERY domain by default. When I arrive at a
site that doesn't work like this then it had better have a good
reason for me to care or I'm leaving. It's also not uncommon for
me to browse the Web from a JavaScript-less text-based browser
(links-family, for example). Preventing me from finding the
information that I need is just silly. It's easier to make the
site work for me than it is to make the site fancy and Web 2.0
ish for people that also don't care and just want the damn
information. xD

JavaScript should be used to enhance the user experience, not
define it. Client-side validation is just part of that. It saves
the user a senseless request/response period and page
re-rendering. I personally believe that you should develop a
JavaScript-less site first. Then and only then should you develop
JavaScript to enhance the experience for supported users, if your
time and budget support this. You should have well defined goals
though. Just because you've added JavaScript doesn't mean you've
made the user experience better. Most sites today make the user
experience worse with JavaScript (which is why NoScript exists).

Regards,


-- 
Brandon McCaig http://www.bamccaig.com/ bamcc...@gmail.com
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software http://www.castopulence.org/ bamcc...@castopulence.org

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Rob Dixon

On 01/10/2011 21:50, shawn wilson wrote:

On Sep 30, 2011 12:59 PM, Rob Dixonrob.di...@gmx.com  wrote:


On the contrary, I think you are missing a few brain cells yourself
Shawn. Your friends at work may tolerate such obnoxious and juvenile
language, otherwise they wouldn't be your friends, but the members of
this list have a far higher price to pay to separate themselves from
your froth.



Heh, the language actually had exactly the effect I was hoping. Your chances
of remembering this exchange are much higher now than if I would have just
said please don't do this, its not very wise.


Not at all. You have made 'this exchange' about your use of abusive
language, and I would have to look back to see what point you were
making. Given your abusive manner I doubt if it was well-explained or
significant.

Rob

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rajeev Prasad
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
optionReading Books/option
optionWriting Stories/option
optionCollecting Coins/option
optionCross Stitching/option
optionTenis/option
optionPlaying 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/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Shlomi Fish
Hi Rajeev,

On Thu, 29 Sep 2011 23:41:33 -0700 (PDT)
Rajeev Prasad rp.ne...@yahoo.com wrote:

 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?

First of all, in addition to CGI.pm and CGI::Simple, there's also CGI-Minimal:

http://search.cpan.org/dist/CGI-Minimal/

I've successfully used it here:

http://www.shlomifish.org/humour/fortunes/show.cgi?mode=random

Otherwise, the size in memory depends on somewhat different factors from those
of the Ubuntu package size. Best way to determine it is to measure it.

Why are you worried about the memory size? Is this
http://c2.com/cgi/wiki?PrematureOptimization ?

Regards,

Shlomi Fish

  
 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
 optionReading Books/option
 optionWriting Stories/option
 optionCollecting Coins/option
 optionCross Stitching/option
 optionTenis/option
 optionPlaying 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/



-- 
-
Shlomi Fish   http://www.shlomifish.org/
My Aphorisms - http://www.shlomifish.org/humour.html

XSLT is the worst thing since non‐sliced bread.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Shawn Wilson


Rajeev Prasad rp.ne...@yahoo.com wrote:

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
optionReading Books/option
optionWriting Stories/option
optionCollecting Coins/option
optionCross Stitching/option
optionTenis/option
optionPlaying Cricket/option
 /select
 
when the form is submitted, i have to get the selected values in an
array. how can i do that?
 

Have your controller parse the post data. See below for my real motivation for 
replying. 

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


You validate data with js? Are you fucking crazy? So, you think that if I want 
to hand you bad data I'm actually going to use your form to do it?

I'm not (read NOT) saying to remove this. What I'm saying is to use js to 
validate for people (like me) who don't read carefully before they click 'go' 
or whatever. You DON'T trust any data at this point. You've got a few other 
points to validate that you might be able to trust: reverse proxy, db (ie, pg 
can validate columns), orm resultset / model, or the controller. Doing 
validation in some of these places might put load where you don't want it 
however this can be considered validation. JS validation is just a ui thing. 
You should also write js to sanitize db data when being sent to a user. That 
way, if some xss got through on the up side, they don't get it on the down 
side. Get it?

Ps, don't put validation (or any other logic in your template). Its a view - 
not for logic. 

Pps, use placeholders or dbic (which does things right for you).

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rajeev Prasad
Mr. Shawn and all others who are etching to criticize ever,
 
do you guys ever realize that you rarely ever answer the question (maybe you 
are not sure), but instead endup criticizing. no code is 'perfect' and people 
are here for help.
 
if you still want to critic, show a working example and maybe then your critic 
will be welcome.
 
brickbats and bouquets are the two faces of same coin, none should affect me - 
BUT again - realize that the question went answered.
 
 
 
by the way, question was: how do you collect the value of a multiselect, 
without using CGI module.
 
 
thx.



From: Shawn Wilson ag4ve...@gmail.com
To: beginners@perl.org beginners@perl.org
Sent: Friday, September 30, 2011 6:26 AM
Subject: Re: How to get the multiselect select box or checkbox element values 
WITHOUT using CGI module



Rajeev Prasad rp.ne...@yahoo.com wrote:

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
optionReading Books/option
optionWriting Stories/option
optionCollecting Coins/option
optionCross Stitching/option
optionTenis/option
optionPlaying Cricket/option
 /select
 
when the form is submitted, i have to get the selected values in an
array. how can i do that?
 

Have your controller parse the post data. See below for my real motivation for 
replying. 

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


You validate data with js? Are you fucking crazy? So, you think that if I want 
to hand you bad data I'm actually going to use your form to do it?

I'm not (read NOT) saying to remove this. What I'm saying is to use js to 
validate for people (like me) who don't read carefully before they click 'go' 
or whatever. You DON'T trust any data at this point. You've got a few other 
points to validate that you might be able to trust: reverse proxy, db (ie, pg 
can validate columns), orm resultset / model, or the controller. Doing 
validation in some of these places might put load where you don't want it 
however this can be considered validation. JS validation is just a ui thing. 
You should also write js to sanitize db data when being sent to a user. That 
way, if some xss got through on the up side, they don't get it on the down 
side. Get it?

Ps, don't put validation (or any other logic in your template). Its a view - 
not for logic. 

Pps, use placeholders or dbic (which does things right for you).

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

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread John SJ Anderson
On Fri, Sep 30, 2011 at 10:19, Rajeev Prasad rp.ne...@yahoo.com wrote:

 by the way, question was: how do you collect the value of a multiselect, 
 without using CGI module.

Octavian did answer that question; I'll do it again: you collect the
value of a multiselect by getting and parsing the value of the query
string in the HTTP request and/or by getting and parsing the value of
the HTTP request body, depending on whether the HTTP request is a GET
or a POST (and other refinements, like whether you want to support
query string paramaters given in a POST request).

The other thing that people are trying to communicate to you is that
*doing* that, and doing it properly, and doing it properly in all the
odd circumstances that usually don't happen but are allowed by the
HTTP spec, is a HARD problem. In addition to being a HARD problem --
and really, it's the worst kind of hard problem, that kind that's easy
to get *almost* right, so it won't fail until much later under the
absolute worst circumstances -- it's a solved problem. There are
multiple modules on CPAN that do this -- CGI and CGI::Simple have both
been mentioned, IIRC -- so, really, there's no need for you to do
this. One of those will work and it won't be any bigger than something
you write yourself.

Now, after that warning and explanation, if you still want to try --
and hey, some times resolving solved problems is good practice for
figuring out how to solve unsolved problems, right? -- then the first
thing to do would be to get and read the HTTP RFC. (Google will help
with that.) Then, get the source for one of those CPAN modules, and
read it. That will show you a fully working, debugged example of how
to do what you're trying to do, with tests -- so you can modify the
code, try to improve it, and see if it still works in the same way.

And after all that, if you come up with a way to do it better, you'll
be perfectly positioned to contribute it back to the maintainers of
the module, and you'll make *everybody's* life better.

chrs,
john.

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rob Dixon

On 30/09/2011 12:26, Shawn Wilson wrote:


You validate data with js? Are you f*g crazy? So, you think that
if I want to hand you bad data I'm actually going to use your form to do it?


On the contrary, I think you are missing a few brain cells yourself
Shawn. Your friends at work may tolerate such obnoxious and juvenile
language, otherwise they wouldn't be your friends, but the members of
this list have a far higher price to pay to separate themselves from
your froth.

If you cannot find some politeness and mammers in you then I suggest you
withdraw and take your fury out on the cat, or the wife, or whomever
else it is that bears the brunt of your feelings when the rest of the
country is in bed.

Rob

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rob Dixon

On 30/09/2011 15:37, John SJ Anderson wrote:

On Fri, Sep 30, 2011 at 10:19, Rajeev Prasadrp.ne...@yahoo.com  wrote:


by the way, question was: how do you collect the value of a
multiselect, without using CGI module.



Octavian did answer that question; I'll do it again:


John, whether or not you meant it, you came over to me as criticising
Rajeev for denouncing every reply to his question. But he said he was 
talking to:



Mr. Shawn and all others who are etching to criticize ever,


and his meaning is clear: Shawn's post was splendidly ill-mannered and
overbearing, and his purpose was made dishonourable and buried by his
vulgarity.

Rob

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread John SJ Anderson
On Fri, Sep 30, 2011 at 13:33, Rob Dixon rob.di...@gmx.com wrote:

 John, whether or not you meant it, you came over to me as criticising
 Rajeev for denouncing every reply to his question. But he said he was
 talking to:

 Mr. Shawn and all others who are etching to criticize ever,

 and his meaning is clear

To the extent that his reply was possibly more focused than I gave him
credit for, I apologize.

The rest of my reply, however,  stands: doing this yourself, unless
it's some sort of learning exercise, is a really bad idea. Further,
had Shawn not already addressed the issue, I would have included
something with the same basic message he delivered (albeit with less
swearing): relying on client-side Javascript code for input validation
is also a Really Bad Idea.

chrs,
john.

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rajeev Prasad


point of that email was not where validation should happen?? it was sent to 
find a solution(sample code) to the problem of collecting value of a multi.

you missed the point, many people miss the point - it is common. Shawn's whole 
post was on 'where' to validate. Question was: how to colle.


Also to tell someone straightaway : go and read the manual, or RFC or 
consortium's recommendations is also not a 'brilliant' suggestion, it shows how 
you do not want to(or can not) respond, but still responding. I would assume 
most of the people know about perldoc/manpages/RFCs and white papers. people 
are looking for sample code, or corrections to their 'published code'. i was 
hoping to get some sample code to take cue from.



after i thought about it a bit more, i liked the suggestion of Octavian 
Rasnita(and also fish), please read his/her response. he understood the 
question (and his response was balanced). (again if u r curious more info:) I 
agree .js can be compromised, but this webpage is in trusted environment with 
extensive user-activity-logging.


thx Bob !!




From: John SJ Anderson geneh...@genehack.org
To: beginners@perl.org
Sent: Friday, September 30, 2011 1:04 PM
Subject: Re: How to get the multiselect select box or checkbox element values 
WITHOUT using CGI module

On Fri, Sep 30, 2011 at 13:33, Rob Dixon rob.di...@gmx.com wrote:

 John, whether or not you meant it, you came over to me as criticising
 Rajeev for denouncing every reply to his question. But he said he was
 talking to:

 Mr. Shawn and all others who are etching to criticize ever,

 and his meaning is clear

To the extent that his reply was possibly more focused than I gave him
credit for, I apologize.

The rest of my reply, however,  stands: doing this yourself, unless
it's some sort of learning exercise, is a really bad idea. Further,
had Shawn not already addressed the issue, I would have included
something with the same basic message he delivered (albeit with less
swearing): relying on client-side Javascript code for input validation
is also a Really Bad Idea.

chrs,
john.

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

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Randal L. Schwartz
 Rajeev == Rajeev Prasad rp.ne...@yahoo.com writes:

Rajeev without using CGI.pm

Whenever someone says without $BEST_WAY_TO_DO_IT, I'm seriously
motivated to say why not?  what is the restriction?.

So, why not?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Brandon McCaig
Rajeev:

On Fri, Sep 30, 2011 at 11:26 PM, Rajeev Prasad rp.ne...@yahoo.com wrote:
 point of that email was not where validation should happen?? it
 was sent to find a solution(sample code) to the problem of
 collecting value of a multi.you missed the point,
 many people miss the point - it is common. Shawn's whole post
 was on 'where' to validate. Question was: how to colle.
*snip*
 after i thought about it a bit more, i liked the suggestion of
 Octavian Rasnita(and also fish), please read his/her response.
 he understood the question (and his response was balanced).
 (again if u r curious more info:) I agree .js can be
 compromised, but this webpage is in trusted environment with
 extensive user-activity-logging.

I don't think that anybody missed the point. The appropriate
response had already been given: either use an existing module or
explain why you can't (and why you don't go and read about CGI
standards yourself; CGI is not Perl specific).

When I read your post the very first thing that I thought to
respond about was also the JavaScript validation. Everything else
had already been covered and relying on JavaScript validation is
never ok, even if you do have a trusted environment. Validation
isn't just to defend against attacks from malicious users. It's
also to ensure data integrity and the correct operation of the
application. Just because I'm using a browser that doesn't
support JavaScript doesn't mean that I'm a malicious user.

In short, people were trying to help, and it's not very polite to
tell people that they aren't helping to your satisfaction. Based
on my own personal experience, I imagine that you are trying to
find the easy button. For whatever reason you don't want to use
existing modules, but you apparently also don't want to go to the
trouble of learning to do it yourself. I'm afraid there rarely is
an easy button. The best help that people can reasonably give you
is to tell you to either use an existing module or RTFM... And I
don't say that to be mean. I know what it's like to just want to
get started being productive and instead be faced with an
overwhelming prerequisist task... It's not fun, but it is
unfortunately the way things go.

Regards,


-- 
Brandon McCaig http://www.bamccaig.com/ bamcc...@gmail.com
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software http://www.castopulence.org/ bamcc...@castopulence.org

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




Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Brandon McCaig
On Fri, Sep 30, 2011 at 11:50 PM, Randal L. Schwartz
mer...@stonehenge.com wrote:
 Whenever someone says without $BEST_WAY_TO_DO_IT, I'm seriously
 motivated to say why not?  what is the restriction?.

Well put, Randal. :D


-- 
Brandon McCaig http://www.bamccaig.com/ bamcc...@gmail.com
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software http://www.castopulence.org/ bamcc...@castopulence.org

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




How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-29 Thread Rajeev Prasad
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
optionReading Books/option
optionWriting Stories/option
optionCollecting Coins/option
optionCross Stitching/option
optionTenis/option
optionPlaying 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.

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-29 Thread Octavian Rasnita

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
optionReading Books/option
optionWriting Stories/option
optionCollecting Coins/option
optionCross Stitching/option
optionTenis/option
optionPlaying 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/