1.判断是否为日期
//是否是日期格式
2.javascript中的提示确认对话框
3.javascript提交action
(1)提交带form的action
(2)提交不带form的action,可以说是个链接
4.html中的超链接提交
//是否是日期格式
function isDateString(sDate)
{
var iaMonthDays =[31,28,31,30,31,30,31,31,30,31,30,31]
var iaDate = new Array(3)
var year, month, day
if (arguments.length != 1) return false
iaDate = sDate.toString().split("-")
if (iaDate.length != 3) return false
if (iaDate[1].length > 2 || iaDate[2].length > 2) return false
year = parseFloat(iaDate[0])
month = parseFloat(iaDate[1])
day=parseFloat(iaDate[2])
if (year < 1900 || year > 2100) return false
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
if (month < 1 || month > 12) return false
if (day < 1 || day > iaMonthDays[month - 1]) return false
return true
}
2.javascript中的提示确认对话框
function rusure_agree()
{
question = confirm("是否确定批准该声请?")
if (question !="0")
{
document.v_AddVacationForm.action="v_ProcessVacation.do?vacation_id=<%=tv.getVacationId()%>";
document.v_AddVacationForm.submit();
}
}
3.javascript提交action
(1)提交带form的action
document.v_AddVacationForm.action="../../v_AddVacation.do";
document.v_AddVacationForm.submit();
(2)提交不带form的action,可以说是个链接
window.location.href="v_AddVacation.do";
4.html中的超链接提交
<a style="cursor: pointer" onclick="check();" >submit</a>