Yii Framework Forum: Add Datepicker In Form - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Add Datepicker In Form yii add datepicker in form Rate Topic: -----

#1 User is offline   Sivanthi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 14-February 13
  • Location:Nagercoil, Kanya Kumari, Tamilnadu. India

Posted 18 March 2013 - 01:09 AM

I just learned how to add datepicker in form.



echo $form->labelEx($model,'datecolumn name');



The Above line display label for date column.


$this->widget('zii.widgets.jui.CJuiDatePicker',array(
				'name'=>'Modelname[datecolumn name]',
				'id'=>'Modelname_datecolumn name',
			    'value'=>Yii::app()->dateFormatter->format("d-M-y",strtotime($model->datecolumn_name)),
				'options'=>array(
    				'showAnim'=>'fold',
				),
				'htmlOptions'=>array(
    				'style'=>'height:20px;'
				),
			)); 




from the above lines,

name and id attributes are represent html attributes [name,id] of the input.

value option displays saved date during edit / update operation.
0

#2 User is offline   Lal Zada 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 90
  • Joined: 06-November 12
  • Location:Lahore, Pakistan

Posted 20 March 2013 - 06:07 AM

THnxxxxxxxx......it works fine <><>
Is it fast? Is it secure? Is it professional? Is it right for my next project? Yes, it is!
Posted Image
Linkedin Facebook Twitter
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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