以下是vbscript函数:
<SCRIPT LANGUAGE="VBScript">
Function checktime()
dim kq_off
dim kq_class
kq_off=time()
kq_class=document.add.kq_class.Value
if kq_class="白班" then
if kq_off<#17:30:00# and kq_off>#8:30:00# then
if (MsgBox("还没到下班时间,您要早退吗?",1, "重要提示"))=2 then
window.history.back(-1)
exit Function
end if
end if
elseif kq_class="中班" then
if kq_off<#22:00:00# and kq_off>#13:00:00# then
if (MsgBox("还没到下班时间,您要早退吗?",1, "重要提示"))=2 then
window.history.back(-1)
exit Function
end if
end if
end if
document.add.action="add_kq_save.asp"
End Function
function checkform()
if document.add.kq_class.Value="" then
MsgBox("您没有输入班次!")
exit Function
end if
Checktime()
End Function
</SCRIPT>
表单:
<form name="add" method="post" onsubmit="return checkform()" >
......
</form>
能否把它转为javascript,我费了很大劲,没能实现
[此贴子已经被作者于2006-2-25 17:43:06编辑过]