This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes jsp login page with normal button, not submitt button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jsp login page with normal button, not submitt button" Watch "jsp login page with normal button, not submitt button" New topic
Author

jsp login page with normal button, not submitt button

alsoumahi alBatal
Ranch Hand

Joined: Nov 22, 2009
Posts: 94
Hi experts , I need to do same as login form of this website , if we can see that wrong entries of username and password shows me alert that I have entered wrong username or password
I have used normal button with ajax , and it is working with me fine , but what I need is to make the normal button activated , so no need the user to click by mouse on the button ,only just hit enter

this is my login form



and this is my ajax



is it possible to make normal button as to be pressed like submit button !!!


thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Make it a submit button. There's no reason not to. You can handle the submit event.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

This would all also be much much easier with a library like jQuery. Doing your Ajax "by hand" is not something that seasoned developers do. There are too many pitfalls and nuances.
alsoumahi alBatal
Ranch Hand

Joined: Nov 22, 2009
Posts: 94
Bear Bibeault wrote:Make it a submit button. There's no reason not to. You can handle the submit event.



but how about if I want to mention the alert for wrong entry " you have entered wrong username or password " , under the login form
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

What about it? Your submit handle can perform any validation that it needs to do.

As this is not about JSP, it's been moved to the HTML/JavaScript forum.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp login page with normal button, not submitt button
 
Similar Threads
The form is not submitting
Iframe to automatic update in jsp according to the database
How to Pass, Username and password and Login from the url
problem in using Ajax calls
how to delete the rows which are checked