﻿// JScript File
        function CheckValue()
        {   
            var txt_Name=document.getElementById('txt_Name');
            var txt_City=document.getElementById('txt_City');
            var txt_Phone=document.getElementById('txt_Phone');
            var txt_MobileNo=document.getElementById('txt_MobileNo');
            var txt_Email=document.getElementById('txt_Email');
            var txt_UrName=document.getElementById('txt_UrName');
            var txt_UrEmail=document.getElementById('txt_UrEmail');
            var strError=document.getElementById('lbl_mandotary');
            
            if(fnValidateInput(txt_Name,"getlen") == 0)
            {
                   alert('Referral Name should not left blank !!');
                    if (txt_Name.disabled==false)
                    {
                        txt_Name.focus();
                    }    
                    return false;
            } 
           else if(!fnValidateInput(txt_Name,"alnum_s"))
            {
                     alert('Special Characters are not allowed for Referral Name !!');
                     if (txt_Name.disabled==false)
                     {
                        txt_Name.focus();
                     }    
                     return false;  
            }
            
            if(fnValidateInput(txt_City,"getlen") == 0)
            {
                   alert('City Name should not left blank !!');
                    if (txt_City.disabled==false)
                    {
                        txt_City.focus();
                    }    
                    return false;
            } 
            else if(!fnValidateInput(txt_City,"alnum_s"))
            {
                     alert('Special Characters are not allowed for City Name !!');
                     if (txt_City.disabled==false)
                     {
                        txt_City.focus();
                     }    
                     return false;  
            }
            
            if (fnValidateInput(txt_MobileNo,"getlen") == 0 && fnValidateInput(txt_Phone,"getlen") == 0)
            {
                alert("Out of the Phone No. or Mobile No. One is mandatory !!");
                if (txt_Phone.disabled==false)
                    {
                        txt_Phone.focus();
                    }    
                return false;
            }
            else if (fnValidateInput(txt_Phone,"getlen") != 0 && fnValidateInput(txt_Phone,"maxlen",7))
            {
                alert("Please enter valid Telephone No. !!");
                if (txt_Phone.disabled==false)
                    {
                        txt_Phone.focus();
                    }    
                return false;
            }
            else if (fnValidateInput(txt_MobileNo,"getlen") != 0 && fnValidateInput(txt_MobileNo,"maxlen",9))
            {
                alert("Please enter valid Mobile No. !!");
                if (txt_MobileNo.disabled==false)
                    {
                        txt_MobileNo.focus();
                    }    
                return false;
            }
            
            if(fnValidateInput(txt_Email,"getlen") == 0)
            {       
                alert('Email should not left blank !!');
                if (txt_Email.disabled==false)
                {
                    txt_Email.focus();
                }    
                return false; 
            }
            else if (!(txt_Email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1))
            {
                alert("Please enter valid Email ID !!");
                if(txt_Email.disabled==false)
                {
                    txt_Email.focus();   
                } // if(txt_Email.disabled==false)
                return false; 
            }
            
            if(fnValidateInput(txt_UrName,"getlen") == 0)
            {
                   alert('Your Name should not left blank !!');
                    if (txt_UrName.disabled==false)
                    {
                        txt_UrName.focus();
                    }    
                    return false;
            } 
            else if(!fnValidateInput(txt_UrName,"alnum_s"))
            {
                     alert('Special Characters are not allowed for Your Name !!');
                     if (txt_UrName.disabled==false)
                     {
                        txt_UrName.focus();
                     }    
                     return false;  
            }
            
            if(fnValidateInput(txt_UrEmail,"getlen") == 0)
            {       
                alert('Your Email should not left blank !!');
                if (txt_UrEmail.disabled==false)
                {
                    txt_UrEmail.focus();
                }    
                return false; 
            }
            else if (!(txt_UrEmail.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1))
            {
                alert("Please enter valid Email ID !!");
                if(txt_UrEmail.disabled==false)
                {
                    txt_UrEmail.focus();   
                } // if(txt_UrEmail.disabled==false)
                return false; 
            }
            
            return true;
    } // function CheckValue()
