Jump to content

Archived

This topic is now archived and is closed to further replies.

narjis

adding css class to Zend_Form_Element_Text

Recommended Posts

I want to add a form with text element

<input type='text class='txt-field-login' name='textfield' /> and button element as <div class="login-btn">
                    <input type="submit" class="login-btn" value="Login">
                </div>

So I added it as

    $email = new Zend_Form_Element_Text('UEmail');
        $email->setLabel('Email')
               ->setRequired(true)
               ->addDecorator('HtmlTag', array('tag'=>'input','class'=>"txt-field-login"));

similarly i added css to my submit button as

             

        $submit = new Zend_Form_Element_Submit('submit');

        $submit->addDecorator('HtmlTag', array('class'=>'login-btn','value'=>'Login'));

but css is not applying to my form text elements.

Please help

Share this post


Link to post
Share on other sites

Try this out:

 

    $email = new Zend_Form_Element_Text('UEmail');
        $email->setLabel('Email')
               ->setRequired(true)
               ->setDecorators(array(
        array('HtmlTag',array('tag'=>'input','class'=>"txt-field-login")),
      ));

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.