Search code examples
javascriptbrowserusability

Should we have Browser Side Validation


For a back office application which is going to be used in house and users trained to use it, does it make sense to have browser side validation. After training users will seldom make mistakes. These mistakes would get caught at the server side. Also bearing in mind that the bandwidth availability is a lesser concern I feel we should avoid browser side validations. This will save the effort of maintaining the same functionality at two places.


Solution

  • First deploy your application without client-side validation. Then observe your users to decide whether the effort of adding client-side validation would be worth the benefit.

    Even with expert users on a fast network, client-side validation can make the application just that little bit faster and more pleasant to use.

    In Java you can use libraries such as Spring Modules Validation. You specify your validation rules in your Java code using annotations, and the library generates JavaScript for client-side validation and Java for server-side. Neat. The original project has been forked and is now under development again.