Q:

How to validate a text box (total) based on two other textboxes with numeric values

I am working on a Telerik RadGrid and within the grid there are multiple radtextboxes like A, B, C and D. I have used radtextbox with regular expression validation to validate A, B and C textboxes with numbers. However, textbox D is A+B+C. My question is if customvalidator is used, how do I validate it within the grid, to alert the user that the total is inaccurate?
Here's a piece of code, I came up with for radD:
> <telerik:RadTextbox ID="radD" runat="server" Autopostback="true"
> Type="Number" text=<%# Bind("TotalD") </telerik:Radtextbox>
> 
> <asp:customvalidator ID =CV1 controltovalidate=radD
> errormessage="Inaccuratetotal"
> clientvalidationfunction="total_validate"/>

My question is: How do I code the clientvalidationfunction for textbox D based on A, B and C. Can anyone point me in the right direction?
Thanks in advance.
Dimpy

A:

You don't include what's in the total_validate function, so I'll write some pseudo code for you.
function total_validate(sender, args){
    var control = $find(sender.controltovalidate);
    var textBoxA = $find(//textBoxA ID).value;
    var textBoxB = $find(//textBoxB ID).value;
    var textBoxC = $find(//textBoxC ID).value;

    if (//textbox a plus b plus c is NOT what you want) 
    {
        arguments.IsValid = false;
    }

}

