Place div infront of input element in Zend form

151 Views Asked by At

Im working on zend form..My problem is..
I have designed sigin and sign up froms using zend forms.My sample snippet is..

$this->addElement('Text', 'email', array(
  'label' => $email,
  'required' => true,
  'allowEmpty' => false,

  'inputType' => 'email',

  'placeholder' => '[email protected]',

));

<div id="email-element" class="form-element">
<input type="email" name="email" id="email" value=""  autofocus="autofocus"     placeholder="[email protected]"></div>

But I need to place a div with name email_icon with class name form_icon infront of input element to place an image..But Im unable to get snippets to place div in zend form elements.Could you please help me for few snippets..o tuts..or some guidance..

1

There are 1 best solutions below

2
On

When displaying the email input element in your view script, as per Zend Framework 2, you can use below code snippet.

echo "<div id='email_icon_div'>";
echo $this->formRow($form->get('email'));
echo "</div><div class='clr'></div>";

I hope this helps.