We've been inserting all javascript after the entire form, or in the head using the onDOMReady event provided by YUI.
Seems to work well for most things. T On Thu, Dec 18, 2008 at 07:59, Bart McLeod <mcl...@spaceweb.nl> wrote: > you will need a decorator on your first element, with placement set to > 'append' or a decorator on the second element, with placement set to > 'prepend'. > > There is a lot on decorators in the manual and on devzone. > > Bart > > maxarbos schreef: > > I have been through a number of examples, but dont think I have >> found/understand what i need to do. >> >> I have a form that i want the rendered html to look like this (or >> similar): >> >> ---------------- >> First Name:<input name="first_name" value=""> >> >> javascript:document.myform.getElementByID('first_name').value click here >> Last Name:<input name="last_name" value=""> >> ---------------- >> >> >> I have a zend form created by: >> >> ---------------- >> class My_Forms_Names extends Zend_Form{ >> >> public function init() >> { >> $this->addElement('text', 'first_name', array( >> 'filters' => array('StringTrim'), >> 'validators' => array( >> 'Alpha', >> array('StringLength', false, array(2, 50)), >> ), >> 'required' => true, >> 'label' => 'First Name', >> 'class' => 'text', >> )); >> >> >> $this->addElement('text', 'last_name', array( >> 'filters' => array('StringTrim'), >> 'validators' => array( >> 'Alpha', >> array('StringLength', false, array(2, 50)), >> ), >> 'required' => true, >> 'label' => 'Last Name', >> 'class' => 'text', >> )); >> >> >> $this->addDisplayGroup( >> array('first_name', 'last_name'), >> 'nameinfo', >> array( >> 'disableLoadDefaultDecorators' => true, >> 'decorators' => array( >> 'FormElements', >> array('HtmlTag', >> array('tag'=>'ol')), >> 'Fieldset' ), >> 'legend' => 'Trips:', >> ) >> ); >> >> } >> } >> ---------------- >> >> >> I want to be able to insert ' >> javascript:document.myform.getElementByID('first_name').value click here ' >> in between the two name fields. >> >> Any suggestions or examples would be great. >> >> Thank you. >> >> >> >