I’m trying to use the CMaskedTextField widget on a form for a Date input. The mask works fine but when i enter the date, modal pop up occurs with a “1” and an “OK” box. Then when I submit the form, i get a input error stating the field cannot be empty???. The field isn’t empty. I think maybe the value I’m entering isn’t being passed back to the model in order to be loaded. Help? Here is my code on the model class setting the attribute:
array('draw_date', 'date', 'format'=>'mm/dd/yyyy')
And here’s my code implementing the mask in the view:
<div class="row">
<?php echo $form->labelEx($model,'draw_date');?>
<?php $this->widget('CMaskedTextField', array(
'mask' => '99/99/9999',
'placeholder' => 'D',
'completed' => 'function(){alert(1);}',
'model' => $model,
'name' => 'draw_date',
));
?>
<?php echo $form->error($model,'draw_date'); ?>
</div>
What am I missing?? Thanks in advance.