这是js函数
this.choseDate = function(obj) {
var myDate = new Date();
if((obj.id) == 'year') {
//修改startDate的onclick事件
$get('startDate').onclick = function() {
alert('startDateYear'); //注意这里!!
WdatePicker({isShowToday:false,dateFmt: 'yyyy' ,maxDate: myDate.getYear()});
}
}if((obj.id) == 'month') { //修改startDate的onclick事件 $get('startDate').onclick = function() { alert('startDateMonth');注意这里!! WdatePicker({isShowToday:false,dateFmt: 'yyyy-MM' ,maxDate: myDate.getYear()}); } } }</pre><br />这是页面内容<br /><pre name="code" class="java">
<td nowrap="nowrap">
起始日期:
<input type="text" skip="true" readonly="readonly" tyle="ime-mode: disabled; width: 80px;" id="startDate" name="startDate" required="false" class="Wdate"
onClick=""
class="TextBox" />
</td>年<input type="radio" name="date" id="year" value="" onclick="javascript:ypgl.choseDate(this);"/>
季度<input type="radio" name="date" id="quarter" onclick="javascript:ypgl.choseDate(this);" value=""/>
月<input type="radio" name="date" id="month" value="" onclick="javascript:ypgl.choseDate(this);"/>