1

How do get the value in the JavaScript function identified in ClientValidationFunction property that was entered in the control that was identified in the ControlToValidate property of a asp:CustomValidator control?

function MyValidateFunction(sender, args) {
    //want to get value of MyControl    
}

<asp:CustomValidator 
    ID="cvAlarmedLocationAddress" 
    runat="server" 
    ControlToValidate="MyControl" 
    ClientValidationFunction="MyValidateFunction" 
    Text="" 
/>
Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231

1 Answers1

2

Check the value of the args.Value property in your javascript. Here is a C# example from the MSDN library:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.customvalidator.clientvalidationfunction.aspx#Y570

RMorrisey
  • 7,637
  • 9
  • 53
  • 71