﻿//is digit
function isDigit(text) {
    return /\d/.test(text);
}

function isDecimal(text) {
    return /^\d*\.?((25)|(50)|(5)|(75)|(0)|(00))?$/.test(text);
}

//is word with space
function isBlank(text) {
    return !/[ก-๛A-za-z0-9]/.test(text);
}

//is email address
function isEmail(text) {
    return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$/.test(text);
}

//text1 and text2 are equal
function isEqualText(text1, text2) {
    return text1 == text2;
}

//range validate
function rageValudator(text1, minLength, maxLength) {
    return text1.length >= minLength && text1.length <= length;
}

function rageValudator(text1, maxLength) {
    return text1.length <= length;
}


