<script>for(i=2000;i<=2010;i++)document.write("<option //这个地方的语法应该是怎样的if i=rs("year") then response.write "selected" end if好像不行// >"+i+"</option>")</script>
可以写为:
<script>
for(i=2000;i<=2010;i++){
document.write("<option");
if(i == rs("year")
document.write("selected");
document.wirte(">" + i + "</option>");
}
</script>
可以写为:
<script>
for(i=2000;i<=2010;i++){
document.write("<option");
if(i == rs("year")
document.write("selected");
document.wirte(">" + i + "</option>");
}
</script>
<script>for(i=2000;i<=2010;i++)document.write("<option "+(i!=<%=rs("year")%>?">":"selected>")+i+"</option>")</script>
</select>
day.options[i].selected = true;;
}
}
<form>
<select name=year onchange=toDate()>
<script>for(i=2000;i<=2010;i++)document.write("<option>"+i+"</option>")</script>
</select>
<select name=month onchange=toDate()>
<script>for(i=1;i<=12;i++)document.write("<option>"+i+"</option>")</script>
</select>
<select name=day onchange=toDay()></select>
<input name=weekday>
</form>
<script>
var arr="日一二三四五六".split("")function toDate(){
with(document.all){
vYear=parseInt(year.options[year.selectedIndex].text)
vMonth=parseInt(month.options[month.selectedIndex].text)
day.length=0;
for(i=0;i<(new Date(vYear,vMonth,0)).getDate();i++){
day.options[day.length++].value=day.length;day.options[day.length-1].text=day.length;
}
}
toDay();
}function toDay(){
vDay=parseInt(document.all.day.options[document.all.day.selectedIndex].value)
document.all("weekday").value="星期"+arr[new Date(vYear,vMonth-1,vDay).getDay()]
}function init(y,m,d){
with(document.all.year)selectedIndex=y-options[0].text
with(document.all.month)selectedIndex=m-options[0].text
toDate();
with(document.all.day)selectedIndex=d-options[0].text
toDay();
}
init(2002,8,15)
</script>
<script>for(i=2000;i<=2010;i++)document.write("<option "+(i!=<%=rs("year")%>?">":"selected>")+i+"</option>")</script>
</select>
?和:分别代表什么
if(i!= <%re("year")%>)
return ">";
else
reutrn "selected>";
// 还是包含 theHour - 12 的内容。hours += (theHour >= 12) ? " PM" : " AM";