用HTML+VBScript制作如图效果的表单。
我记得我好像回答过这样的问题。。。
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>计算星期几</title></head><body><table width="300" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999"><form name=form1><tr><td width="55%" height="25" align="right" valign="middle" bgcolor="#FFFFFF">请输入年:</td><td width="45%" bgcolor="#FFFFFF"> <input onKeyUp="value= place(/[^\d]/g,'')" onBlur="value= place(/[^\d]/g,'')" name="a" type="text" size="4" maxlength="4" /></td></tr><tr><td height="25" align="right" valign="middle" bgcolor="#FFFFFF">请输入月:</td><td bgcolor="#FFFFFF"> <input onKeyUp="value= place(/[^\d]/g,'')" onBlur="value= place(/[^\d]/g,'')" name="b" type="text" size="2" maxlength="2" /></td></tr><tr><td height="25" align="right" valign="middle" bgcolor="#FFFFFF">请输入日:</td><td bgcolor="#FFFFFF"> <input onKeyUp="value= place(/[^\d]/g,'')" onBlur="value= place(/[^\d]/g,'')" name="c" type="text" size="2" maxlength="2" /></td></tr><tr><td height="25" align="right" valign="middle" bgcolor="#FFFFFF">计算该日期是星期几:</td><td bgcolor="#FFFFFF"> <input name="button" type="button" value="计算结果" onclick="shijian()" /></td></tr></form></table><script language="vbscript">sub shijian()if lue="" or lue="" or lue="" thenalert("请输入年、月、日!")exit subend ifif len( lue)<>4 thenalert("年份输入有误!")exit subend ifa1= lueb1= luec1= lueriqi=CDate(a1&"-"&b1&"-"&c1)str=datepart("w",riqi)if str=1 thenstr="星期日"elseif str=2 thenstr="星期一"elseif str=3 thenstr="星期二"elseif str=4 thenstr="星期三"elseif str=5 thenstr="星期四"elseif str=6 thenstr="星期五"elseif str=7 thenstr="星期六"end ifalert(a1+"年"+b1+"月"+c1+"日是:"+str)end sub</script> </body></html> 答案补充好了,我在你单独发给我的问题里回答了~那个肯定没问题了~。
答:详情>>