﻿// JScript File

//required field validation
function validate_required(field,alerttxt)
{
    with (field)
    {
        if (value==null||value=="")
        {
            alert(alerttxt);
            return false;
        }
        else
        {
            return true;
        }
    }
}
//valid email validation
function validate_email(sender, args)
{
    var ele = document.getElementById(sender.controltovalidate);
    var email = ele.value;
    var emailRegEx = /[^@.][^@]+[^@.]+@[^.@]+(?:\.[^.@]+)+/g;
    var matches = emailRegEx.exec(email);
    if (matches == null || matches != email)
    {
        args.IsValid = false;
    }
    return args.IsValid;
}

