﻿// JScript File


    function ltrim (s)
        {
            return s.replace( /^\s*/, "" );
        }
        function validate()
        {
            var name=document.getElementById("TextBox1");
            var mobile=document.getElementById("TextBox2");
            var feed=document.getElementById("txtbody");           
            var email=document.getElementById("txtfrom");
             
           
     
 
           
           
            
            if (ltrim(name.value)=="")
            { alert("Please Enter Name"); name.value=""; name.focus(); return false; }
            
              str2A=name.value;
            var mobExpA = /^[-A-Z a-z]+$/;
	        if(str2A.match(mobExpA)==null)	
	        { alert("Special Character Not Accepted  In Name Field"); name.focus(); return false; }
	        
	        
                  if (ltrim(mobile.value)=="")
            { alert("Please Enter Mobile No"); mobile.value=""; mobile.focus(); return false; }
              str2=mobile.value;
            var mobExp = /\d{10}/;
	        if(str2.match(mobExp)==null)	
	        { alert("Invalid Mobile No Ex:9790933474"); mobile.focus(); return false; }
	        
	           str2d=mobile.value;
            var mobExpd =/^[0-9]+$/;
	        if(str2d.match(mobExpd)==null)	
	        { alert("Invalid Mobile No Ex:9790933474"); mobile.focus(); return false; }
	        
	           if (mobile.value.length>10)
            { alert("Invalid Mobile No Ex:9790933474"); mobile.focus(); return false; }
            
            
	        
             if (ltrim(email.value)=="")
            { alert("Please Enter Email Address"); email.value=""; email.focus(); return false; }
            
             str=email.value;
            var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	        if(str.match(emailExp)==null)	
	        { alert("Invalid Email Address"); email.focus(); return false; }
	        
              if (ltrim(feed.value)=="")
            { alert("Please Enter FeedBack"); feed.value=""; feed.focus(); return false; }
             
	        
         
            
           
            
        
           
        }


