Problem in Javascript Text Validation

Apr 20 2011 8:56 AM
when i m trying to use the variable "txtFName1" as shown below. it doesn't work in the 'if'.
Is there any way to use the variable in  the 'if' in .net 3.5

var txtFName1 =  (document.getElementById('<%=txtFName.ClientID %>');
               
            if (txtFName1== "") {
                alert("First Name field can't be left blank");
                txtFName1.focus();
                return false;
                }



Pls help
Thanx in Advance....
Eagerly waiting for the response.
          

Answers (6)