Thursday, 18 December 2014

Yii:: Jquery Mask Input For Date

1. Download Masked Input Plugin by digitalBush
2. If you’re using Yii, create folder js outside the protected folder, store the js file inside there, put this code in your page.
<?php
$cs=Yii::app()->clientScript;
$cs->registerScriptFile(Yii::app()->baseUrl.’/js/jquery.maskedinput-1.2.2.js’,CClientScript::POS_HEAD);
?>
3. Then, assign the field to be masked
<SCRIPT language=”javascript”>
$(‘#date_1′).mask(“99-99-9999″,{placeholder:”_”});
</SCRIPT>

No comments:

Post a Comment