Re: quickform: how to add style <span class="classname">formelement</span> to ONE element

From: Date: Tue, 01 Aug 2006 18:46:20 +0000
Subject: Re: quickform: how to add style <span class="classname">formelement</span> to ONE element
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24812@lists.php.net to get a copy of this message
l Burnerheimerton wrote: > I have on element I want to highlight in yellow. > > $form->addElement('text','note', 'Note:'); > > I have tried several variants of: > > $form->addElement('text','note', 'Note:', > array('class' => 'hilite;')); > > where "hilite" is a class referenced in a stylesheet. > > but they don't work. I'm pretty sure it can be done > without altering the form/element templates. It works. It generates something like <input ... class="hilite;">. (would be correct without the ';'). What you actually want to achieve seems to be hidden in the subject: > how to add style <span class="classname">formelement</span> to ONE > element And this is only possible by altering the template for this element: $form->setElementTemplate(<yourtemplate>, 'note'); Regards, Mark

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