It's not a secret anymore!*
The moose likes Servlets and the fly likes form validation 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 » Java » Servlets
Bookmark "form validation" Watch "form validation" New topic
Author

form validation

syidah mk
Greenhorn

Joined: Feb 03, 2005
Posts: 13
hi..

i need help... is it possible to
display the error in the form using out.println rather than
alert message box when validating a form using javascript ???
Florian Heinisch
Greenhorn

Joined: Mar 03, 2005
Posts: 15
In your Servlet you have to check your form fields' content. If there is something the user did not enter correctly you just "build" the whole form again and place the error message(s) into the form where ever you want them to show up. So the user sees the same form plus your error message(s).
[ March 04, 2005: Message edited by: Florian Heinisch ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
More likely this kinda behaviour is from server-side validation.
Preetham Chandrasekhar
Ranch Hand

Joined: Nov 05, 2003
Posts: 98
yup...u can do it before you save it to the db and check if its null...if it is...then send it back to the client stating that the following errors have to be entered.


"In theory, there is no difference between theory and practice. But, in practice, there is."<br /> - Jan L.A. van de Snepscheut
Annie Smith
Ranch Hand

Joined: Mar 05, 2005
Posts: 172
You could use Struts Validator for that.


Cheers!<br /><b>Annie</b>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: form validation
 
Similar Threads
New with Struts
getting the field values of inner form
DynaValidtorform
Class form Adapter VS Object form Adapter
Accessing Japanese characters from text area