Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
How to add validation in jsp
reena Mehta
Greenhorn
Posts: 24
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
how to add validation in
jsp
using
java
scripts
please give me some example
Swastik Dey
Bartender
Posts: 2270
20
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It depends upon the type of validation you wish to implement. For e.g. the following code will check whether a given name is empty or not.
<script> function isEmpty(){ var data=document.getElementById("name").value; if(data.length==0){ alert("Name is required"); return false; } return true; } </script> <body> <form> Enter name <input type=text id="name"> <br> <input type=submit value="Ok" onClick="return isEmpty()"> </body>
Swastik
Ulf Dittmer
Rancher
Posts: 43081
77
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Be aware that -whatever validations you perform on the client- also needs to be performed on the server. You can't trust client input.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
embed multiple portlets in jsp
validator framework in struts
Struts framework
Design advice needed. Data validation
Client side validation using JSP ???
More...