
$(document).ready(function(){
 });


function validateField(name)
{
    var _val = $.trim(document.getElementById(name).value);
    
    if(_val == "")
    {
        return false;
    }
    return true;
}


function PostBackAction()
{
             
         var _bool = true;
        var _innertext = "<ul><span><b>The following errors have occurred:</b></span>";
                

        if(!validateField("textArea1"))
        {
            _innertext += "<li>Comments can't be left blank. Please fill in comments.</li>";
            _bool = false;
        }
        
        if(!validateField("textBox1"))
        {
            _innertext += "<li>Name can't be left blank. Please fill in name.</li>";
            _bool = false;
        }
        
        var _nameVal= $("#textBox1").val(); 
        var _commentLength = $("#textArea1").val();
        
        if(_nameVal != null)
        {
            if(_nameVal.length > 75)
            {
                _innertext += "<li>Name can't be greater than 75 characters. Please change Name to be less than 75 characters.</li>";
                _bool = false;
            }
        }
        
        if(_commentLength != null)
        {
            if(_commentLength.length > 3000)
            {
                _innertext += "<li>Comments can't be greater than 3000 characters. Please change comments to be less than 3000 characters.</li>";
                _bool = false;
            }
        }
        
        if(_bool == false)
        {
                $("#errorSummary").css("display", "block");
                _innertext += "</ul>";
                $("#errorSummary").html(_innertext);
                return false;
        }
        
        if(_bool == true)
        {
            javascript:__doPostBack('button1','')
       }

}