I have a JSP( a form) that calls a servlet when I click the submit button. I want to add javascript validation to the form fields. When I try to embed the script it does not run. I tried to link the file to the JSP, but that also did not work. My Javascript works well with just the HTML page. Is it possible to call the js file from within the JSP before the servlet is called?
raghujosh
0
Junior Poster
Recommended Answers
Jump to PostIf you want validation in the servlet, then use java code after you get the request.
But that is not very good because you have already sent the request. The idea is to validate before sending the request at the jsp.So you can try this:
All 3 Replies
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
raghujosh
0
Junior Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.