Client-side validation in ASP .NET MVC 3
I am currently watching tutorial videos on ASP .NET MVC 3 and have come to the section about enabling and disabling cli开发者_如何学编程ent side validation.
My question is why would you ever want to disable client-side validation?
As a developer, would users having JavaScript disabled even be something to consider since server side validation will always be there as a backup anyway?
What are the implications of a user browsing your site with JS disable if you have client-side validation enabled other than that the validation will only run on the server-side?
If the customer has no requirement for you to disable client-side validation, what other reasons would there be to disable it?
Client-side validation is merely an add-on, a way to give a user a more polished experience when entering information into a form. Server-side validation is where the magic happens (or where it should happen).
Client-side validation can be disabled by the user (via disabling JavaScript). There may also be requirements by the customer (the person you write the software for) that it can't run JavaScript (for whatever reason).
According to another Stack Overflow question, at least 1% of users in the EU, and 3% in the US keep JavaScript disabled.
I personally keep NoScript running in Firefox on sites that I don't trust. Normally unless the experience is horrible I'll keep it disabled.
As far as your question about whether or not we should care if JavaScript is disabled: Should your website require JavaScript?
Re: Implications of a user browsing with JavaScript disabled, Backup for people with JS disabled? and for your final question, what reasons are there for disabling JavaScript, that's been answered here.
精彩评论