asp.net - Need help in login validation using javascript -


Can someone please tell me what is the error here? By using javascript I am valid user input. When I click on the login button without checking the javascript function, the welcome page goes to. Here's my code:

  & lt; Script type = "text / javascript" & gt; Function valid login (if (document.getElementById ("txtUserName"). Value == "") {Warning ("Please enter your username"); Description is false;} (if document.getElementById ("txtPassword" ). Value == "") {Warning ("Please enter your password"); Details are false;}} & lt; / script & gt; Protected Zero Page_Load (Object Sender, EventErgus E) {BtnLogin.Attributes.Add ("OnClick", "ValidLogin Return ();");}  

I think Post code that you are using ASP.NET (Page_load event).

I think it will be easier to handle the validity, that is,


Comments