Hello I am trying to do a checkbox display like:
<input name="choice2" id="choice2" value="1" type="checkbox">
<label for="choice2" class="optional">Credit Card</label><br />
Some text
<input name="choice2" id="choice2" value="1" type="checkbox">
<label for="choice2" class="optional">Credit Card</label><br />
Some text
I got very close with the following code:
$lbl_spagym = 'Credit Card<br />
<p class="description">Some text</p><br />';
$chk_spagym = new Zend_Form_Element_Checkbox('chk_spagym');
$chk_spagym->setLabel($lbl_spagym)
->setDecorators(array(
'ViewHelper',
'Description',
'Errors',
array('Label', array('placement' => 'APPEND', 'escape' => false)),
array('HtmlTag', array('tag' => 'div'))
));
It renders as:
<div>
<input type="hidden" name="chk_bank" value="0" />
<input type="checkbox" name="chk_bank" id="chk_bank" value="1" checked="checked" />
<label for="chk_bank" class="optional">Credit Card<br />
<p class="relocation_descr">Some text</p><br />
</label></div>
But I need the <p></p> to be out of the label tag because ‘some text’ is a description and not a label. I played with decorators for days but can not get this behavior right. Would thanks any comments on that.
I sorted my problem with: