87,901
社区成员
发帖
与我相关
我的任务
分享
var getDaysInMonth = function(year,month){
month = parseInt(month,10);
var temp = new Date(year,month,0);
alert(year); alert(month);
return temp.getDate();
}
<form id="frm1" name="frm1" method="post" action="ftt_cltmain_viewOK.asp">
<select id="slt_year" name="slt_year">
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
</select>
当前月份
<select id="slt_month" name="slt_month" onChange="getDaysInMonth(document.getElementById('slt_year').value,this.value)">
<% for i = 1 to 12 %>
<option value="<%=i%>"><%=i%></option>
<% next %>
</select>
<input type="hidden" name="hdn_day" id="hdn_day" value="getDaysInMonth(document.getElementById('slt_year').value,this.value)">
</form>
<script>
$(document).ready(function(){
$('#slt_month').change(function(){
$.ajax({
url: "ftt_cltmain_viewOK.asp",
type: "POST",
data: $(form).serialize(),
success: function(response) {
},
error: function(request,error){
}
});
})
})
</script>