Cjuidatepicker Not Displaying Using A Link Button ?

In a admin.php page i use a Link Button to "Add new client registration" using a form.

when enter data in a date field CjuiDatePicker is not displaying.?

But

when open the form without "link button" the date field displays the clendar to enter date.

plz see my code ,where is the problem…thanks


<?php echo $form->labelEx($model,'p_end_date'); ?>

	<?php

	$this->widget('zii.widgets.jui.CJuiDatePicker', array(

        	'model'=>$model,

			'value'=>'p_end_date',

        	'attribute'=>'p_end_date',

        	// additional javascript options for the date picker plugin

        	'options'=>array(

            	'showAnim'=>'fold',

            	'dateFormat'=>'yy-mm-dd',

        	),

        	'htmlOptions'=>array(

            	'style'=>'height:20px;',

            	//'value'=>'3/3/2011',

        	),

    	));	

	//echo $form->textField($model,'p_end_date',array('size'=>40,'maxlength'=>100)); ?>

     	

		<?php echo $form->error($model,'p_end_date'); ?>



Link Button code, when clicked it opens a client registration form in a Dialog.




<?php echo CHtml::link('Add Client ', "",  // the link for open the dialog

	array(

    	'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',

    	'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"));

?>



Dialog cjuidialog code




<?php

$this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog

	'id'=>'dialogclient',

	'options'=>array(

    	'title'=>'Create Client ',

    	'autoOpen'=>false,

    	'modal'=>true,

    	'width'=>550,

    	'height'=>470,

	),

));

?>