This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to validate textboxes in a jsp page like the asp page of in .NET

 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jsp page with three textboxes , i need to validate if they are empty or not

Some sites suggest javascript.

There is a button in the form which transfers the values from the three textboxes onto a servlet. So if i leave the three textboxes as blank , then when i press the submit button i should see messages (in the jsp page itself) that the three fields are required?

How do i do it without javascript?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this were 1998, you'd submit the page and have the page re-displayed with the error messages. But this is 2012 and you'd use JavaScript.

Of course, you still need to validate on the server. Never assume that client-side validation has executed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic