How to use email validation check through java script in jsp page
This is detailed java code that explains how to use java script validator in jsp page. This validator checks for valid email given by the user. valid_email.jsp page has 'onSubmit' attribute, which is set to ValidateForm(), in the html 'form' element. When user submits the form then this method is called which validates the email entered by the user in the text box on the page. The full code for the jsp can be seen below. Before running this code create a new directory named "user" in the tomcat-6.0.16/webapps and WEB-INF directory in same directory.
Save this code as a .jsp file named "valid_email.jsp" in the directory Tomcat-6.0.16/webapps/user/ and you can run this jsp page with url http://localhost:8080/user/valid_email.jsp in address bar of the browser.
If user leave this textbox blank and click on submit button, a alert message will open.....
If user enters an invalid email id and click on submit button, a alert message will open.....