RE: [PEAR] Quickform: Complex rule adding confusion

From: Date: Thu, 17 Jul 2003 11:18:47 +0000
Subject: RE: [PEAR] Quickform: Complex rule adding confusion
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6640@lists.php.net to get a copy of this message
> -----Original Message----- > From: Bertrand Mansion [mailto:bmansion@mamasam.com] > Sent: 16 July 2003 22:33 > >> $refRules['check'][] = array($language['L_RequireReferenceNumber'], >> 'required'); >> $form->addGroupRule('referenceGroup', $refRules); >> >> However no rules seem to get applied to my input boxes. I can submit >> the form freely - no javascript appears in the HTML. I'm starting to >> think I may need to specify that the rules run on the client side - >> but how do I specify this using the above rule adding technique? > >Look there for more info on form validation for groups, it might be clearer: > >http://www.appelsiini.net/~tuupola/php/peardoc2/package.html.html-quickform. >intro-validation.html > >You can add client validation by adding 'client' as a last parameter in your rule >definition arrays. Hi Bertrand, I altered my rule to have the 'client' on the end... $refRules['check'][] = array($language['L_RequireReferenceNumber'], 'required', null, 'client'); $form->addGroupRule('referenceGroup', $refRules); Yet still get no joy from any javascript creation - as if the 'client' instruction isn't being picked up! Validation does work, but only on the server side - so a message gets embedded in the HTML upon page reload. The documentation at the URL you provided doesn't seem to mention setting the group rules on the client side, so i assumed they are no different to when you add a single rule for running on the client side. A little Confused, Mike C. ---------------------------------------------- This mail sent through http://www.ukonline.net

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