narjis Posted January 27, 2012 Share Posted January 27, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/255864-adding-css-class-to-zend_form_element_text/ Share on other sites More sharing options...
premiso Posted January 31, 2012 Share Posted January 31, 2012 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")), )); Quote Link to comment https://forums.phpfreaks.com/topic/255864-adding-css-class-to-zend_form_element_text/#findComment-1313133 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.