aspose file tools
The moose likes JSP and the fly likes Client side validation using JSP ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Client side validation using JSP ???" Watch "Client side validation using JSP ???" New topic

Client side validation using JSP ???

Anjali Sen

Joined: Feb 26, 2003
Posts: 15
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,
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
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

Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1049
Hi Anjali,
an example for JavaScript-Validation:

post, if you have questions about it
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Client side validation using JSP ???