I have the following form:
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'new-agenda-entry',
'enableAjaxValidation'=>true,
'action'=>'')); ?>
<div class="four columns">
<div class="right top5 sufix10">
<?php echo $form->labelEx($model,'eventTime'); ?>
<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'name'=>'UserAgenda[eventTime]',
'model'=>$model,
'options'=>array(
'dateFormat'=>'yy-mm-dd',
'minDate'=>'new Date()',
) // jquery plugin options
));?>
<?php echo $form->error($model, 'eventTime'); ?>
</div>
<div class="right top5 sufix10">
<?php echo CHtml::dropdownList('eventTime_hour', false, $this->getHourArray()); ?>
<?php echo CHtml::dropdownList('eventTime_min', false, array('00'=>'00', '30'=>'30')); ?>
</div>
<?php echo $form->labelEx($model,'note'); ?>
<?php echo $form->textField($model, 'note');?>
<?php echo $form->error($model, 'note'); ?>
The model is successfully validated on the server as I can see the response in Firebug:
{"UserAgenda_eventTime":["Event time cannot be blank."],"UserAgenda_note":["Note cannot be blank."]}
The message seems fine, so does the html but the hidden inputs generated by yii remain hidden and empty.
in the action maybe (create or update) you have to uncomment // $this->performAjaxValidation($model);
like this you have an ajax validation, if the problem persist I think posting it to yiibootstrap discussion in yii forums i better, I see that you use yiibootstrap, try it with default yii form widget.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With