function onlyDigits(s) {
var str = /^[0-9]*$/;
return (str.test(s));
}
function onlyHalfWidth(labelValue) {
var reg=/[^\x00-\xff]/ig;
return ! (reg.test(labelValue));
}
function emailFormat(s) {
var str = /^[_\-\.0-9a-zA-Z-]+@([0-9a-zA-Z-]+\.)+[a-zA-Z]{2,4}$/;
return str.test(s);
}
function checkFileType(filePath, allowType) {
var hint = document.getElementById('attachment.hint');
hint.innerHTML = "";
if(filePath.lastIndexOf(".")!=-1){
var suffix = (filePath.substring(filePath.lastIndexOf(".")+1, filePath.length)).toLowerCase();
var isMatch = false
var fileType = allowType.split(',');
for(var i =0;i<fileType.length;i++){
if(fileType[i].trim()==suffix){
isMatch = true;
}
}
if(!isMatch){
var msg = errors.show('errors.fileType',' '+allowType+' ');
hint.innerHTML = msg;
return false;
}
}
return true;
}
function emailFormat(s) {
var str = /^[_\-\.0-9a-zA-Z-]+@([0-9a-zA-Z-]+\.)+[a-zA-Z]{2,4}$/;
return str.test(s);
}
function phoneFormat(s) {
var str = /^[0-9-+()]*$/;
return str.test(s);
}
function checknumberletter(s){
var str = /^[0-9a-zA-Z]{0,}$/;
return str.test(s);
}
/**** check date**/