Hello there,

I'm new on this list, and in Zend Framework.

I'm looking to the forms, here is what I want:

<form ... action="/search/list">
<div class="formlabel"><label for="lastname" class="label
optional">lastname</label></div>
<div class="formfield"><input type="text" name="lastname"
id="lastname" value="Smith"></div>
<div class="formsubmit"><input type="submit" name="searc" id="searc"
value="Search"></div>
</form>

here is my code:

$form = new Zend_Form();
$form->setMethod('post');
$form->setAction('/search/list');
$lastname = new Zend_Form_Element_Text('lastname', array('label' =>
'lastname', 'value' => 'Smith'));
$lastname->addDecorator('HtmlTag', array('tag' => 'div', 'class' =>
'formfield'));
$lastname->addDecorator('Label', array('tag' => 'div', 'class' => 'formlabel'));

$submit = new Zend_Form_Element_Submit('search', array('label' =>
'Search', 'value' => 'Search'));
$submit->addDecorator('HtmlTag', array('tag' => 'div', 'class' =>
'formsubmit'));
$submit->removeDecorator('Label');
$form->addElements(array($lastname, $submit));
$form->submit->removeDecorator('Label');
$this->view->form = $form;

but I get this output:

<form ... action="/search/list"><dl class="zend_form">

<div><label for="lastname" class="formlabel optional">lastname</label></div>
<div class="formfield">
<input type="text" name="lastname" id="lastname" value="Smith"></div>
<div class="formfield"><dt>&nbsp;</dt><dd>
<input type="submit" name="search" id="search"
value="Search"></dd></div></dl></form>


so, I _do_ leave <label> tags, <dt> and <dd> tags (at submit element
too), and I want to put the submit button to _one_ html tag (at submit
element).

Please somebody point me what I miss? I'm confused...


Thanks:

airween

Reply via email to