You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
|
|
var Email = /^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.){1,4}[a-z]{2,3}$/i;
|
|
var filter=/^\s*[, .A-Za-z_-]{0,16}\s*$/;//外国人的姓名
|
|
var reg = /^([, .a-zA-Z]|\d)*$/;//验证只能是数字和字母
|
|
var tim = /^\d{1,2}\/\d{1,2}\/\d{2,4}$/ //时间验证
|
|
|
|
//添加评论验证
|
|
function CheckReview(){
|
|
|
|
//UserName的验证
|
|
if(trim($('strUserName').value)==""){
|
|
popHint($('strUserName'), 'Enter your name please', {_event : 'blur'});
|
|
$('strUserName').focus();
|
|
return false;
|
|
}
|
|
if(!filter.test(trim($('strUserName').value))){
|
|
popHint($('strUserName'), 'The name is not valid', {_event : 'blur'});
|
|
$('strUserName').focus();
|
|
return false;
|
|
}
|
|
//strComment评论内容的验证
|
|
if(trim($('strComment').value)==''){
|
|
popHint($('strComment'), 'Enter your reviews please', {_event : 'blur'});
|
|
$('strComment').focus();
|
|
return false;
|
|
}
|
|
if(len(trim($('strComment').value))>300){
|
|
popHint($('strComment'), 'Your reviews is greater than 300', {_event : 'blur'});
|
|
$('strComment').focus();
|
|
return false;
|
|
}
|
|
//Check_in_date体验时间的验证
|
|
// if(trim($('Check_in_date').value)==''){
|
|
// popHint($('Check_in_date'), 'Enter the Check-in Date please', {_event : 'blur'});
|
|
// $('Check_in_date').focus();
|
|
// return false;
|
|
// }
|
|
// if(!tim.test(trim($('Check_in_date').value))){
|
|
// popHint($('Check_in_date'), 'This Check-in Date is not valid. Example: 08/08/2008.', {_event : 'blur'});
|
|
// $('Check_in_date').focus();
|
|
// return false;
|
|
// }
|
|
}
|
|
|
|
|
|
//酒店评论筛选函数
|
|
function user_type()
|
|
{
|
|
document.user_form.submit();
|
|
} |