Thursday, March 10, 2005

.NET: Getting aggressive with validation: Hacking WebUIValidation.js

The built-in validation in .NET can carry you far. While not totally sold on pushing my business logic that close to the presentation layer, the Validation suite certainly makes it easy to create robustly validating ASPX pages. That said, quickly I became dissatisfied with its limited method of notifying the user of an invalid state. Sure, a text string in red notifying you of the offending data is a good start - but I like stuff that CANNOT be missed by the user. We know how users can be :) I prefer attention grabbing shit, like turning the background red behind an invalid field. Good look missing that! Furthermore, it confuses me why MS didn't include the option to move cursor focus to the offending fields. That seems like a no-brainer. All this clever JS validation stuff, but nobody thought the user would actually jump right to the invalid entry field? duh.

So, for my present project as a gift to my incredibly fucking cool client, I am doing some off-the-clock work to make this happen. Here's the breakdown of what is to be improved from regular MS validation:

1. Aggressive, easy-to-notice RED BACKGROUND behind offending data fields
2. Focus which automatically moves to the first of aforementioned fields
3. Homogenous behavior on both the client and server side, incase someone bypasses the JS or plain can't run it (poor bastard)

0 Comments:

Post a Comment

<< Home