Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client side validation using JSP ???

 
Anjali Sen
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I know client side validation using JSP is not good. but my client side req. is like this. can u any one tell me how to effectively use JSP for
client side validation. pls provide me some sample code or urls.
With Regards,
Anjali
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way to to client-side validation is to have code in the browser. This means it will have to be JavaScript not JSP.
There are obviously issues about portability between browsers and users disabling JavaScript etc. A lot will depend upon the intended audience of the application (e.g. is it Internet or Intranet based) and how much control that you have over the version and settings of their browsers.
You will probably need to provide validation in 2 places:
1) Initial validation client-side using JavaScript to enusre that they have filled in all mandatory fields, that numbers are valid etc.
2) Server-side. Repeat the validation in part 1 to cater for the fact that some users may have disabled JavaScript and add additional validation that can access the database to perform consistency checks.
Hope this helps
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anjali,
an example for JavaScript-Validation:

post, if you have questions about it
cb
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic