if (iSecond < 10) { sTemp = sTemp + "0" + iSecond ;}
else { sTemp = sTemp + iSecond ;}
return sTemp ;
}
//------------------------------------------------------------------------------
//2.4 本函数用于检查文本框txtName内的数据是否是日期型数据
//------------------------------------------------------------------------------
function JCheckTxtIsDate(txtName,sLabel)
{
var sValue ;
sValue = JLTrim(JRTrim(txtName.value)) ;
if (JIsDate(sValue))
{
txtName.value = JFormatDate(sValue,"-") ;
return true ;
}
else
{
strTemp = "“" + sLabel + "”的值<" + txtName.value + ">不是合法的日期型数据。" + unescape("nn") ;
strTemp = strTemp + "合法的日期型数据格式是:<YYYY-MM-DD>或<YYYY-M-D>。" + unescape("nn") ;
strTemp = strTemp + "如:<2000年4月23日>可写成<2000-04-23>或<2000-4-23>。"
window.alert(strTemp) ;
txtName.select() ;
txtName.focus() ;
return false ;
}
}
//------------------------------------------------------------------------------
//2.4 本函数用于检查文本框txtName内的数据是否是时间型数据
//------------------------------------------------------------------------------
function JCheckTxtIsTime(txtName,sLabel)
{
var sValue ;
sValue = JLTrim(JRTrim(txtName.value)) ;
if (JIsTime(sValue))
{
txtName.value = JFormatTime(sValue,":") ;
return true ;
}
else
{
strTemp = "“" + sLabel + "”的值<" + txtName.value + ">不是合法的时间型数据。" + unescape("nn") ;
strTemp = strTemp + "合法的时间型数据格式是:<HH:MM:SS>或<HH-M-S>。" + unescape("nn") ;
strTemp = strTemp + "如:<20时8分2秒>可写成<20:08:02>或<20:8:2>。"
window.alert(strTemp) ;
txtName.select() ;
txtName.focus() ;
return false ;
}
}
// ----------------------------------------------------------------------------------
//2.5 本函数用于获取系统的当前日期(日期格式是"YYYY-MM-DD")
// ----------------------------------------------------------------------------------
function JGetCurrentDate()
{
var iYear,iMonth,iDate,Today,sDate ;
Today = new Date() ;
iYear = Today.getYear() ;
iMonth = Today.getMonth() + 1 ;
iDate = Today.getDate() ;










