Re: HTML_QuickForm & Rules.

From: Date: Tue, 16 Dec 2003 14:10:04 +0000
Subject: Re: HTML_QuickForm & Rules.
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9571@lists.php.net to get a copy of this message
Hmmm ... Well okey lets say I want the user to write his email address in the form ... There for i use $form->addRule('email', 'Please insert your email', 'email'); so the user doesn't input invalid email ... But I also want this to be a required field ... I was wondering if i can somehow user email and required on same rule ? Or do i have to make 2 diffrent rules ? like: $form->addRule('email', 'Doesn't look like a email', 'email'); $form->addRule('email', 'There must be a email', 'required'); Also i was wondering the same with compare ... I saw in the manual like I said a way with compare'ing password fields and have them also be a required fields but there you had to make a function that made the compare and then you used it like this: $form->addRule('passwd1', 'Please enter password', 'required'); $form->addRule('passwd2', 'Please confirm password', 'required'); $form->addFormRule('cmpPass'); And then I come again to the thing i was wondering isn't there any inbuilt feature in the QuickForm to make the same thing compare and be required, and same with email ... If not then it would be a nice feature ... Thanks for you answear :) Bertrand Mansion wrote:
<helgi@trance.is> wrote :
I was wondering ... Isn't there any way to make $form->addRule('email', 'Please insert your email', 'email'); and complare aslo a reqiured field ? With out making my own rules ? I've made my own rule to compare two password fields and user addFormRule and then in addRule i have required (Just like i saw in the manual :) ) but my thought was isn't there any inbuilt features to do this ? If so i haven't found them and i thank the person that can answear my question :D
Sorry, I don't understand what you want to do ? Bertrand Mansion Mamasam


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