初学者的问题

wenya6210 2004-01-14 02:03:56
谁能教我下面用VBStript怎么写
<script language=javascript>
<!--
function month_onchange() {
var MySelect=document.all("year")
with (document.all("year")) {
var sValue=options[selectedIndex].value;
}
var MySelect=document.all("month")
with (document.all("month")) {
var sValue=options[selectedIndex].value;
}
}
//-->
</script>

还有就是JScript和VBScript有什么区别
...全文
74 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wenya6210 2004-01-14
  • 打赏
  • 举报
回复
我想在选择年或月后下方能自动调整天数
如1月31天
2月20天
……

还有就是为什么我用<%……%>就出错,用<Script LANGUAGE=VBScript>……</Script>就没事呢?
晕!!!
先谢了
wenya6210 2004-01-14
  • 打赏
  • 举报
回复
<html>
<head><title> 勤怠表 </title></head>
<body bgcolor="#FFFFFF">
<form id=f>
<font size=6>       </font>

<select id=year name=year>
<% for n = 2004 to 2008 %>
<option value= "<%=n%>"> <%=n%> </option>
<%next%>
</select> 年度

<select id=month name=month onchange="return month_onchange()">
<option>请选择月份 </option>
<% for m = 1 to 12 %>
<option value="<%=m%>"> <%=m%> </option>
<%next%>
</select> 月份の勤怠表 </form>

<Script LANGUAGE=VBScript>
function month_onchange()
MySelect=document.all("year")
with MySelect
sValue=options[selectedIndex].value;
end with
year=sValue
MySelect=document.all("month")
with MySelect
sValue=options[selectedIndex].value;
end with
month=sValue
end function
</Script>

<p>
<font size=2>     </font>
<td class=p2 align=right> <font color=D11B00> </font> 日 </td>
<font size=2>        </font>
<td class=p2 align=right> <font color=D11B00> </font> 勤务种类 </td>
<font size=2>         </font>
<td class=p2 align=right> <font color=D11B00> </font> 通勤时间 </td>
<font size=2>          </font>
<td class=p2 align=right> <font color=D11B00> </font> 备考 </td><br></p>
<Script LANGUAGE=VBScript>''''''''''''''''''''''''
y = year
m = month
''''''''''''''''''''''''
select case m
case 1,3,5,7,8,10,12
getdays=31
case 4,6,9,11
getdays=30
case 2 '判断是否为闰年
if y mod 4=0 and y mod 100>0 or y mod 400=0 then
isrn=true
else
isrn=false
end if
if isrn=true then getdays=29 else getdays=28
case else
getdays=0
end select

dim day
day = 1
Do while day <= getdays ''''''''''''''''''''''''''''Do while day <= maxdate respone.write()
if day < 10 then
response.write ("   0" & day)
else
response.write ("   " & day)
end if
</Script>
<font size=2>       </font>
<select onchange=chg_manu(this.value,document.search_form.manuid.value) name=kind>''''''''''''''''''''''''''
<option value=1 selected> 通常 </option>
<option value=2> 有休 </option>
<option value=3> 无休 </option>
<option value=4> 代休 </option>
<option value=5> 代休出勤 </option>
<option value=6> 祝日(祭日) </option>
</select><font size=2>   </font>

<select onchange=chg_manu(this.value,document.search_form.manuid.value) name=time>'''''''''''''''''''''''''''
<option value=" " selected> 9:00~18:00 </option>
<option value=" "> 9:30~18:30 </option>
<option value=" "> 00:00~00:00 </option>
</select><font size=2>   </font>
<input type="text" name="bikou" size="20"> <br>
<Script LANGUAGE=VBScript>
if day > 31 then
exit do
end if
day = day + 1
Loop
</Script>
</body>
</html>
wenya6210 2004-01-14
  • 打赏
  • 举报
回复
不好意思,代码没贴全
我怎样才能把值传出去
<Script LANGUAGE=VBScript>
function month_onchange()
MySelect=document.all("year")
with MySelect
sValue=options[selectedIndex].value;
end with
year=sValue
MySelect=document.all("month")
with MySelect
sValue=options[selectedIndex].value;
end with
month=sValue
end function
</Script>


<% y = year '这个值传不过来
m = month
select case m
case 1,3,5,7,8,10,12
getdays=31
case 4,6,9,11
getdays=30
case 2 '判断是否为闰年
if y mod 4=0 and y mod 100>0 or y mod 400=0 then
isrn=true
else
isrn=false
end if
if isrn=true then getdays=29 else getdays=28
case else
getdays=0
end select
%>
x_gn 2004-01-14
  • 打赏
  • 举报
回复
<script language=vb>

function month_onchange()
MySelect=document.all("year")
with MySelect
sValue=options[selectedIndex].value;
end with
MySelect=document.all("month")
with MySelect
sValue=options[selectedIndex].value;
end with
end function
</script>
wenya6210 2004-01-14
  • 打赏
  • 举报
回复
哪位大侠能帮帮我呀

28,405

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧