• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validate username and password

 
pradip thite
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, friends, i want to validate username and password in javascript...i want to validate username and password with database values..if login failed i want to display alert message...ok..but problem is that i have index.jsp page...after clicking login button control goes to homepage.jsp..okk.. in index.jsp i have taken dropdown to show designation...i select desgn then control goes to repective homepage... in homepage i am checking uname and password with database values..
if login successful it goes to respective pages...but if login failed it has to show me alert message...
how can i do that ?? please help me friends...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34225
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pradip,
You wouldn't be validating the password in the browser via JavaScript. You need to validate the password on the server side.

A common way of dealing with this is to redirect to a different page based on the success/failure of validation. What happens now when you click on the login button? Hopefully it goes to a servlet that can perform this logic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic