checkConference.js
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:4k
源码类别:
电子政务应用
开发平台:
Java
- var now = new Date();
- var currentHour = now.getHours();
- var currentMinute = now.getMinutes();
- function checkIt(form)
- {
- if ( !stripWhitespace(form.subject.value) || isEmpty(form.subject.value) )
- {
- alert("请输入会议标题");
- form.subject.focus();
- return false;
- }
- if(form.subject.value.length>100)
- {
- alert("会议标题过长,最多100字");
- form.subject.focus();
- return false;
- }
- if( form.boardroomId.value =="-1" )
- {
- alert("请选择会议室!");
- form.boardroomId.focus();
- return false;
- }
- if( !isEmpty(form.startDate.value) )
- {
- if(!isVNEXDate(form.startDate.value))
- {
- alert("会议开始日期非法");
- form.startDate.focus();
- return false;
- }
- if( currentTime > form.startDate.value)
- {
- alert("会议开始日期必须在本日之后");
- form.startDate.focus();
- return false;
- }
- }
- if( form.startDate.value =='' )
- {
- alert("会议开始日期非法");
- form.startDate.focus();
- return false;
- }
- if( form.endDate.value =='' )
- {
- alert("会议结束日期非法");
- form.endDate.focus();
- return false
- }
- if( !isEmpty(form.endDate.value) )
- {
- if(!isVNEXDate(form.endDate.value) )
- {
- alert("会议结束日期非法");
- form.endDate.focus();
- return false;
- }
- if( currentTime > form.endDate.value)
- {
- alert("会议结束日期必须在本日之后");
- form.endDate.focus();
- return false;
- }
- }
- if( !isEmpty(form.endDate.value) && !isEmpty(form.startDate.value) )
- {
- if(form.startDate.value > form.endDate.value)
- {
- alert("会议结束日期必须在会议开始日期之后");
- form.endDate.focus();
- return false;
- }
- }
- if( form.startDate.value == form.endDate.value )
- {
- // if the time equal current time
- if ( form.startDate.value == currentTime )
- {
- // if the start hour less than current hour
- if ( form.startHour.value < currentHour )
- {
- alert("会议开始小时必须在当前小时之后");
- form.startHour.focus();
- return false;
- }
- if( form.startHour.value == currentHour )
- {
- if( form.startMinute.value <= currentMinute )
- {
- alert("会议开始分钟必须在当前分钟之后");
- form.startMinute.focus();
- return false;
- }
- }
- if ( form.startHour.value == form.endHour.value )
- {
- if( form.endMinute.value <= form.startMinute.value )
- {
- alert("会议结束分钟必须大于开始分钟");
- form.endMinute.focus();
- return false;
- }
- }
- }
- // if the start hour equals end hour
- if ( form.startHour.value == form.endHour.value )
- {
- if( form.endMinute.value <= form.startMinute.value )//form.startMinute.value
- {
- alert("会议结束分钟必须大于开始分钟");
- form.endMinute.focus();
- return false;
- }
- }
- // if the start hour more than end hour
- if ( form.endHour.value < form.startHour.value )
- {
- alert("会议结束小时必须大于开始小时");
- form.endHour.focus();
- return false;
- }
- }
- // judge the attendee if is empty
- if ( form.attendeeIDList.value=='' )
- {
- alert("请选择参加人!");
- form.attendeeIDList.focus();
- return false;
- }
- if(form.description.value.length>500)
- {
- alert("会议描述过长,最多500字");
- form.description.focus();
- return false;
- }
- return true;
- }