jquery - How can I client validate with a mask in MVC3, but model validate without? -


I usually store phone numbers as 10 digits in the database. However, I want to use a jQuery masked input plugin to guide the user with a mask like this: ( _) -___ Unfortunately, my string lamps The attribute fails with my \ d {10} regex attribute on the client. I can create my own Custom Phone Verifier feature, but it is always collided with other features. Is there a way to pick and choose which valid, which valid client-side are? I am using the code- first of all, I definitely want my string lamps to stay on my model. I do not want them to be always participating in client verification.

If you can disable client-side validation for this property and maybe implement some yourself After you can consider a custom model binder that is just connected to this property (see) and before it hits your model, erase the extra bit of data in it.

Comments