Author: DanielHac | Posted on: 1/25/2005 2:02:54 PM | Views : 834

I have been struggling trying to create a validator that uses the value of two controls combined to determine validation. For example if you had two input boxes and you wanted to make sure that the total of the two boxes added up to 100.





This is fairly easy to do server side but it gets tricky to do client side. The problem is that CustomValidator only allows one control to be assigned to "ControlToValidate". And the on change event won't trigger validation for the second control.





Things also get very complicated when you want do do validation in a repeater where each repeater item has it's own submit button. I have found a solution to this, and I thought I would post it since I was so frustrated at not being able to find an example solution to this situation.





The following code is written for asp.net 2.0 (beta 1) so some things may need to be changed and I don't know if validation groups are supported in asp.net 1.1.

Go to the complete details ...