﻿function ValidateForm() {
    if(document.getElementById("NameTextBox").value=="")
    {
        ShowMessage("Your Name is required");
        return false;
    }
    if(document.getElementById("EmailTextBox").value=="")
    {
        ShowMessage("Your Email is required");
        return false;
    }
        
    if(!checkMail(document.getElementById("EmailTextBox").value))
    {
        ShowMessage("Valid Email is required");
        return false;
    }

    return true;
            
//    if(document.getElementById("SendButton")!=null)
//    {
//        document.getElementById("SendButton").click();
//    }
}

function ValidateLicense()
{
    if(document.getElementById("AccountManagerTextBox").value=="")
    {
        ShowMessage("Requested by is required");
        return false;
    }
    if(document.getElementById("LicenseTextBox").value=="")
    {
        ShowMessage("License to is required");
        return false;
    }
    if(document.getElementById("HIDTextBox").value=="")
    {
        ShowMessage("HID is required");
        return false;
    }
    if(document.getElementById("RequestedOnDatePicker").value=="")
    {
        ShowMessage("Expiration date is required");
        return false;
    }
        
            
    if(document.getElementById("SendButton")!=null)
    {
        document.getElementById("SendButton").click();
    }
}


function ClearForm()
{
    document.getElementById("NameTextBox").value="";
    document.getElementById("EmailTextBox").value="";
    document.getElementById("CompanyTextBox").value="";
    document.getElementById("PositionTextBox").value="";
    document.getElementById("DepartmentTextBox").value="";
    document.getElementById("MessageTextBox").value="";
}

function ClearLicense()
{
    document.getElementById("RequestTextBox").value="";
    document.getElementById("AccountManagerTextBox").value="";
    document.getElementById("LicenseTextBox").value="";
    document.getElementById("HIDTextBox").value="";
    document.getElementById("ExpirationTextBox").value="";
}

//function ValidateForm()
//{
//    if(document.getElementById("SendButton")!=null)
//    {
//        document.getElementById("SendButton").click();
//    }
//}
