Jsp code for validating email address

13-May-2017 04:26

Now you can ask questions directly to me on my new site ASPForums.

Shows you how to write a script that ensures your form is filled in correctly before it's sent to your server.Here is the code for the verify Email() function: This function will return a false value if the user does not type in an email address in the correct format or if the user fails to type in the same email address in both fields.If the email addresses passes both these tests, then the function will return a true value.Server-side validation is more secure but often more tricky to code, whereas client-side (Java Script) validation is easier to do and quicker too (the browser doesn't have to connect to the server to validate the form, so the user finds out instantly if they've missed out that required field! In this tutorial we'll build a simple form with client-side Java Script validation.You can then adapt this form to your own requirements.

Shows you how to write a script that ensures your form is filled in correctly before it's sent to your server.

Here is the code for the verify Email() function: This function will return a false value if the user does not type in an email address in the correct format or if the user fails to type in the same email address in both fields.

If the email addresses passes both these tests, then the function will return a true value.

Server-side validation is more secure but often more tricky to code, whereas client-side (Java Script) validation is easier to do and quicker too (the browser doesn't have to connect to the server to validate the form, so the user finds out instantly if they've missed out that required field! In this tutorial we'll build a simple form with client-side Java Script validation.

You can then adapt this form to your own requirements.

If the strings are different, an alert warns the user that the email addresses are not the same and returns a false value.