zend-decorators

Zend Framework: How do I remove the decorators on a Zend Form Hidden Element?

I'm trying to remove the default decorators on a hidden form element. By default, the hidden element is displayed like this: <dt>Hidden Element Label (if I had set one)</dt> <dd><input type="hidden" name="foobar" value="1" id="foobar"></dd> I don't want my hidden element to take up space on my page. I want to remove all the default de...

Zend_Form_Decorator - How to add attrib to Zend_Form_Element_Hidden ?

I have 2 requirements: 1) All hidden input elements should be affected without removing standard decorators. 2) This should happen WITHOUT having to specify it on a per-element basis. All I need is for a CSS class to be attached to the DT & DD tags IF the element type is Zend_Form_Element_Hidden. I've tried creating custom HtmlTag, DtD...

Zend Framework Checkbox Decorators

What I am trying to accomplish is to have checkbox labels display after checkbox input fields (to the right of them). I am using these decorators now: private $checkboxDecorators = array( Label, array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'checkbox')), 'ViewHelper', array(array('row' => 'HtmlTag')...

Disable escape in Zend_Form_Element_Multicheckbox

I'm working with the Multicheckbox element and trying to figure out how to disable "escape" in the FormMulticheckbox helper. I've managed to send an escape parameter to the "description" helper, and that works fine (see "escape" => false below): $this->setDecorators(array( "ViewHelper", "Errors", array(array("internal" => "H...

porting template to zend framework

Hi, I got few issues proting a pear based form to zend form. I have few elements I need : Basic Elements Groups Group Elements Sections I previously used templates to render the forms on Pear. I obviously cannot use pre-existing zend decorators, since I need to specify css classes for each of the components of my base elements. To ...

How to change the layout of a form with Zend_Form decorators?

I'm totally confused about how decorators work. This is the html structure that I'm trying to achieve: <form id="" action="" method="post"> <fieldset><legend>Contact form</legend> <p> <label for="name">Name</label> <input type="text" name="name" id="name" size="30" /> </p> <p> <label for="email">Ema...

Zend Form, table decorators

Hello, I am having an incredibly difficult time to decorate a Zend form the way I need to. This is the HTML structure I am in need of: <table> <thead><tr><th>one</th><th>two</th><th>three</th><th>four</th></thead> <tbody> <tr> <td><input type='checkbox' id='something'/></td> <td><img src='src'/></td> <td><input type='text' id='some...

Zend_Form: How to add an element to the DD tag of another element?

So, what I would like to do is take one form element and add it to another one: <!-- original --> <dl class="zend_form"> <dt>label</dt> <dd><input id="1"></dd> <dt>label</dt> <dd><input id="2"></dd> </dl> <!-- desired outcome --> <dl class="zend_form"> <dt>label</dt> <dd> <input id="1"> <input i...

Setting decorators to Zend_Form_Element_Checkbox

I have a zend form comprised of 4 subforms. 1 of these subforms has 4 elements, and one of those elements is a zend_form_element_checkbox. I have 4 different display groups (1 for each subform) - one is : 'billing address', one is 'credit card info' , 'notifications' and 'misc' Assuming that 'notifications' is the part that has the chec...

Override Separator on Zend_Form Radio Elements When Using a ViewScript Decorator

I am using ViewScripts to decorate my form elements. With radio elements, the separator can normally be overridden, but the override is being ignored when I use the ViewScript. When I use the below call and ViewScript, the radio elements are separated by a '<br />' rather than the space I've specified. If leave the default decorators,...

How to display 2 display groups in the same div in a zend form?

Hello, How can I display more than 1 display group WITHIN a div? I simply need to show a visual separation - but within the same div. Is there a way to show more than 1 display group within a div? for example: to achieve the following in zend forms: <div style="width: 100%;"> <div style="width: 50%; float: left; paddi...

Zend_Form, overwriting decorators by default, not working

I am having issues with zend_form and zend_decorator. I have created a decorator class to default all forms to use list elements, however it doesn't seem to be working! Essentially my_decorator_design extends zend_form and then my forms extend the decorator. Ideas? class My_Decorator_Design extends Zend_Form { public function load...

Zend_Form and Decorator help

<select name="day" id="day"> <option value="0" label="Day:">Day:</option> <option value="1" label="1">1</option> </select> <select name="month" id="month"> <option value="0" label="Month:">Month:</option> <option value="1" label="January">January</option> </select> <select name="year" id="year"> <opt...

How to decorate 'Errors' using standard decorators?

I have set the form decorators in this way: <?php $this->setElementDecorators(array( 'Label', array(array('labelTd' => 'HtmlTag'), array('tag' => 'td', 'class' => 'name')), array(array('elemTdOpen' => 'HtmlTag'), array('tag' => 'td', 'class' => 'form','openOnly' => true, 'placement' => '...

how to decorate the error message

this is the decorator code $mydecorate = array( 'ViewHelper', array('Errors', array('placement' => 'append','class' => 'error')), array('Label', array('separator' => '')), array('HtmlTag', array('tag' => 'p', 'class' => 'element-form')) ); html result of two input elements with the above decorator: <p...

What's the simplest way to create a Zend_Form tabular display with each row having a radio button?

I've seen simple examples of rendering a Zend_Form using decorators, but I'm not sure they are able to handle the issue I'm facing very well. I query the database and get an array of user objects. I want to display these users as a form, with a radio button next to each of them and a submit button at the bottom of the page. Here's rou...

Zend Form problem:Setting decorators for textarea and textinput length values

In my Zend form code I have the following $address = new Zend_Form_Element_Textarea('accounts_address'); $address->setLabel('Address') ->setAttrib('rows','4') ->setAttrib('cols','4') ->addFilter('StripTags') ->addFilter('StringTrim')...

How can I add multiple divs or fieldsets to a zend_form using decorators?

I'm trying to generate this html heirarchy in my zend_form display group: <div class="settings"> <div class="dashed-outline"> //want to add this div <fieldset disabledefaultdecorators="1" id="fieldset-settings"> <legend>Cards</legend> </fieldset> </div> </div> This is what I have cur...

zend_form display group inside foreach

I want to create a display group generated from foreach() clause output. I can't seem to get the syntax correct. Here's the business logic: for each category row find the associated fees output the category description as a label and the fees as radio buttons then create a display group with the fees as the group elements and the cat...

How can I set the class for a <dt> element in a Zend_Form?

I'm trying to set the width of the style for a group of < dt > elements in a Zend_Form. Is there a way to set a class for a dt element, so the end result would be something like this: <dt id="name-label" class="xyz" > // trying to add the 'class="xyz" <label class="required" for="name">Name:</label> </dt> <dd id=...