The builtin validators are great for basic stuff, something I find missing is a conditional validator -- i.e. one that validates only if a third condition is met. For example, I have a form with payment methods on it. If Terms is selected, I require nothing more. If Credit Card is selected, I need to require CCNumber, CCExp, and CardHolderName. I've not found a good/easy way to do this with the built-ins.
Adding another property to the existing validators (like CheckedControl) would solve this problem. Otherwise, Custom Validators and/or roll-your-own javascript are your alternatives.
Discussion on:
Don't know how I manage to do this so often.
Since you mention amateurs, you should probably point out that the less than exemplary results that may result from client-side validation include security breaches. Client-side pages can be edited to remove the validation.
Client-side validation exists to avoid a trip to the server if the data is invalid, which is certainly valuable, but should be regarded as useless for security purposes.
Client-side validation exists to avoid a trip to the server if the data is invalid, which is certainly valuable, but should be regarded as useless for security purposes.
- Keyboard Shortcuts:
- Prev
- Next
- Toggle









































