| Author |
Validation in jsp
|
RaviSingh Kumar
Ranch Hand
Joined: Sep 04, 2007
Posts: 52
|
|
Hi, I am using javascript for clientside validation of TextField in JSP. For that i am using 'alerts' to show error message. But i want to show error message just next to the textfield which is incorrect instead of alerts. Waiting for some solution to this. Thanks in advance.
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
hi ravi sing, if you want to display error message near to the particular field,then you can go for ajax or serverside validation... if you go serverside validation then using expression(or sriptlet)we can display message ..where ever you want..but page will be refresh..so, you go for ajax(example you see gmail login page by giving wrong username ..you want that type only right?) thanks & regards, seetharaman
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
Moving to our HTML/Javascript forum
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
if you want to display error message near to the particular field,then you can go for ajax or serverside validation...
Of course not. Whether validation is done n the client or the server has nothing to do with placing the message next to the text field.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
Explore the innerHTML property of DOM elements to see how to add content to an element. With regards to validation: while client-side validation is nice for the user, your server code should never rely upon it and should always re-validate the data regardless of whether it was validated on the client or not.
|
 |
 |
|
|
subject: Validation in jsp
|
|
|