I want to validate the Email id format is correct or not
While typing Emailid in Razor textbox it should display the tick mark if it is in correct format
Otherwise error message should display below the textbox.
Please guide me.. how to do it
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could write a custom validation attribute:
that will be used to decorate your view model property with:
and then assuming you have a controller:
and a view:
you could just write a simple script to plug into the unobtrusive validation framework and achieve what you are looking for. You would then create a separate javascript file (email.js) with the following contents:
and the last step would of course be to include the 3 scripts to your page to enable client side validation: