Yii Framework Forum: bootstrap required field in Textfield - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

bootstrap required field in Textfield How to set "required" in htmloption() Rate Topic: -----

#1 User is offline   winson kong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 25-October 10

Posted 10 June 2015 - 04:29 AM

Hi all,

Actually i want to do like this

<input type="text" class="form-control" name="InputCode" id="InputCode" placeholder="Enter Code" required>

but try in Yii textfield is does'n work

$form->textField($userEntity,'f_name',array('class'=>'form-control','placeholder'=>'New Member','required'=>''));
0

#2 User is offline   Bizley 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 922
  • Joined: 29-July 14
  • Location:Wrocław

Posted 06 July 2015 - 05:22 AM

Your post is in wrong section.

Anyway, in Yii 1.1 you can do it like that:

'required' => true


If you don't want this to be rendered

required="required"


you must set renderSpecialAttributesValue to false.
http://bizley.pl ʕ•ᴥ•ʔ
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users