Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Add Datepicker In Cform

$
0
0
Hi, All,

I want to add a datepicker (like CJuiDatePicker) into one element in CForm.
public function getForm() {
	$return=new CForm(array(
		'showErrorSummary'=>true,
			'elements'=>array(
				'networkDate'=>array(	
					'type'=>'text',
					'hint'=>'Date for network',
					'attributes'=>array(
						'class'=>'hasDatepicker',
					),
				),
				"<script type=\"text/javascript\">
				/*<![CDATA[*/
				jQuery(function($) {
					jQuery('#NetworkDetails_networkDate').datepicker({'changeYear':true,'dateFormat':'mm/dd/yy'});
				}
				/*]]>*/
				</script>",
...


My code is not working. I must be missing something but I don't know.
Is anyone has same issue, and I want to know how you solve the issue.

Thanks,
Johnny

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>