RE: Passing Form As Argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Richard Lynch [mailto:ceo@xxxxxxxxx] 
Sent: Friday, April 21, 2006 2:15 PM
To: Nicolas Verhaeghe
Cc: php-general@xxxxxxxxxxxxx
Subject: RE:  Passing Form As Argument


On Fri, April 21, 2006 1:02 am, Nicolas Verhaeghe wrote:
> I'm new to the list so "Hello" to all. I'm drafting a function.php 
> page, which will be included() in the pages in need. How would I pass 
> a form as an argument of a function? From the name parameter of the 
> form element or perhaps an ID:
>
>
> function checkForm(theForm){
> 	//Form validation code omitted.

You wouldn't.

See, you probably don't really want to pass every form through the same
validation function, because every form is different.

And every input should have the strictest validation possible for that
input.

So you can't really have a generic checkForm function, any more than you can
turn on your "Security" switch and magically make it safe.

It just plain doesn't work like that.

So your function, for now, should just know what form it is checking because
there is only one form it checks.

-----------------------

I have functions which dynamically generate client-side javascript
validation functions according to the name of the field, its type (text,
password, email, drop down, radio button, textarea, and what not).

Same thing server-side.

TIMTOWTDI but I cannot be the only one with the idea.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux