Yii Framework Forum: Jui datepicker with not required date field - Yii Framework Forum

Jump to content

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

Jui datepicker with not required date field Rate Topic: -----

#1 User is offline   r4nd4ll 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 09-December 10

Posted 23 December 2010 - 10:55 AM

Hi,
I have model 'date_start' field and I want to use CJuiDatePicker widget to set up date.
		<?php echo $form->labelEx($advertisement,'date_start'); ?>
		<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
				'name'=>'date_start',
				'attribute'=>'date_start',
				'model'=>$advertisement,
		));?>		
		<?php echo $form->error($advertisement,'date_start'); ?>


When I set 'date_start' field as required everything works great, but if I unset required validator from this field it does not remember date value after validate:( Is this datepicker widget bug or I miss something?
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,834
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 23 December 2010 - 12:26 PM

You will have to use a 'safe' validator.
Read more in the Definitive Guide To Yii.

/Tommy
Don't forget to read The Definitive Guide to Yii (1.1/2.0 en) | The class reference (1.1/2.0) has the details
1

#3 User is offline   r4nd4ll 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 09-December 10

Posted 23 December 2010 - 04:06 PM

View Posttri, on 23 December 2010 - 12:26 PM, said:

You will have to use a 'safe' validator.
Read more in the Definitive Guide To Yii.

/Tommy


Thank's Tommy.
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