Re: Question Regarding HTML_QuickForm

From: Date: Wed, 24 Dec 2003 08:44:54 +0000
Subject: Re: Question Regarding HTML_QuickForm
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9815@lists.php.net to get a copy of this message
Thanks Alex, The point which I am not clear, what I need to do in my action.php, do I have to write if $_POST['MyTextBox'] is empty then this means required field was empty. If I have to do this then what is point in making server side rule ( $form->addRule('MyTextBox', 'Your name is required', 'required','','server'); If possible, can you give me some example so that I can understand more. Thanks Sanjay ----- Original Message ----- From: "Alexey Borzov" <borz_off@cs.msu.su> To: "Sanjay" <sanjay92@hotmail.com> Cc: <pear-general@lists.php.net> Sent: Wednesday, December 24, 2003 12:10 AM Subject: Re: [PEAR] Question Regarding HTML_QuickForm > Hi! > > Sanjay wrote: > > 1. I want to add rule for required field. This works ok, if I do client > > validation. For server validation, when I hit Submit button, instructions > > from action=action.php gets carried out and no validation is done. How to > > make it work ?. I am probably missing something here so please help. > > You are missing the obvious fact that server-side validation is performed > *after* the form is submitted and in the script that accepts the submit, not > *before* or *instead* or somewhere else. > > > 2. Is it possible to addRule so that it validates from client side as well > > as server side as well. I mean to validation at both end. Is it possible. > > Yes. Server-side validation is always on, if you set the 'client' modifier, then > client-side one is switched on. > >

« previous php.pear.general (#9815) next »