• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form validation

 
syidah mk
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More likely this kinda behaviour is from server-side validation.
 
Preetham Chandrasekhar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use Struts Validator for that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic