Re: HTML_Quickform

From: Date: Fri, 26 Jan 2007 22:40:27 +0000
Subject: Re: HTML_Quickform
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26422@lists.php.net to get a copy of this message
On Thu, Jan 25, 2007 at 04:47:57PM +0100, arnaud sellenet wrote: > Le 25 janv. 07 à 15:25, Patrick Heckeler a écrit : > >Hi folks, > >I've used the HTML_Quickform package to display some forms. > >To have a flexible design, I used the Quickhtml renderer: > >$this->renderer =& new HTML_QuickForm_Renderer_QuickHtml(); > >$this->addElement('text', 'zone', "Zone: ", > >array('class' => > >'field', 'size' > >=> 50, 'maxlength' => 255, 'value' => > >$post->getRaw('zone'))); > >. > >. > >. > >$this->addRule('zone', 'errormessage', 'required', null, > >'server'); > >$this->accept($this->renderer); > >The form is displayed quite fine, but no error message is vissible > >after > >committing the form in a invalid state. The client-side validation > >works > >fine, but the error text ($this->setJsWarnings("pretext", > >"posttext");) is > >not changeable... > >Whats the correct way to get the error message from the form > >object, and how > >can I display it in my html template? I can't find a method to > >extract the > >error message from the form object! > >How can I change the js-popup text? $this->setJsWarnings("pretext", > >"posttext"); has no effect (but also occures no error)... > >Thanks a lot > >Patrick > Don't you call $form->validate() AFTER accepting the renderer. If > it's the case, the server-side errors won't show up For an example, see me talking to myself: http://marc.theaimsgroup.com/?l=pear-general&m=116735241220597&w=2 -- Brian Clark

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