• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 882
  • Last Modified:

CustomValidator client-side validation

I currently have the following code on an aspx page:

function validOtherAssets(source, arguments)
     {
          if (document.getElementById('txtOtherAssets').value > 0 && document.getElementById('txtOtherDesc').value == '')
          {
               arguments.IsValid = false;
          }
          else
          {
               arguments.IsValid = true;
          }
}

<asp:CustomValidator Runat=server ID="cuvOtherDesc" ClientValidationFunction="validOtherAssets();" ErrorMessage="--" Display=None></asp:CustomValidator>

However, I am getting an error on the "arguments" variable.  It claims to be undefined.  My understanding is that "source" and "arguments" are expected variables with a custom validator.

Any thoughts?
0
ccboyd
Asked:
ccboyd
1 Solution
 
neil_richardsCommented:
I believe the problem is the "();" in ClientValidationFunction="validOtherAssets();"

This should read ClientValidationFunction="validOtherAssets"
0
 
ccboydAuthor Commented:
thanks!  that was it!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now