Re: QuickForm::element::setRequired

From: Date: Wed, 09 Apr 2003 17:31:50 +0000
Subject: Re: QuickForm::element::setRequired
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-4734@lists.php.net to get a copy of this message
le 9/04/03 18:18, Wolfram Kriesing à wolfram@visionp.de a écrit : > is it possible, to set any rule (required in my case) from with in an > element class? > > class form_email extends HTML_QuickForm_text { > function form_email() > { > $this->HTML_QuickForm_text('newData[email]', > 'Email','size="30"'); > } > } > > i got a simple class as shown above. > what i would like to do now is smthg like > > $this->setRule('Please give your email','required') > > inside the class. > since i have this field in many forms and the handling is always the > same, i just created my own class for it ... > > is this possible. No because the list of required elements (as well as the validation rules) are kept in the main QuickForm object. Bertrand Mansion Mamasam

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