2013-05-08 2 views
0

Я хочу создать вход формы, параллельный форме zend. как это сделать?Форма ввода pararel в форме zend

у меня есть этот код:

$this->addElement('select', 'curr', array(
'label'  => 'Price', 
'required' => true, 
'multiOptions' => array('usd' => 'USD', 'idr' => 'IDR'), 
)); 

$this->addElement('text', 'price', array(
'label'  => '', 
'required' => true, 
)); 

И я хочу, как это:

<div class="control-group"> 
    <label class="control-label required" for="f-price">Price</label> 
    <div class="controls"> 
    <select id="f-curr" name="f[curr]> 
    <option value='usd'>USD</option> 
    <option value='idr'>IDR</option> 
    </select> 
    <input type="text" value="" id="f-price" name="f[price]"> 
    </div> 
</div> 

как я могу это сделать ??

кто-нибудь, пожалуйста, помогите мне.

ответ

0
$countryList=array('USA','IDR'); 

$country = $this->createElement('select', 'country'); 
    $country->setLabel(': country') 
      ->setAttrib('class','select') 
      ->addMultiOptions($countryList) 
      ->setRequired(false); 


    $this->addElement($country); 
$firstName = $this->addElement('text', 'fprice', array(
    'filters' => array('StringTrim', 'StringToLower'), 
     'id' => 'fprice', 

     'required' => true, 

     'label'  => ': name' 

    )); 
Смежные вопросы