2

I have a select list on my modal and an input field. The select list contains the contact types like email, phone number etc. Is it possible to dynamically apply the model validation on the input field like when the user selects the email option the input field is validated for the email and if he selects the phone number the input field is validated against the provided phone number format. Is it possible to achieve by using the mvc3.net data annotation or should i go for some jquery plugins.

1 Answer 1

1

Validation of this type is simply handled by JQuery code called either on character entry or on blur. Take home message: this isn't hard so don't go looking for complex solutions! You don't need a plugin or data annotation, etc.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.