views:

455

answers:

2

I have a form that has some standard asp.net validators and some custom validators.

I know how to force the whole page to validate.

But how on blur of a form field can i force the validator(s) that are looking at the field fire, not all validations on the page.

I expect I am missing some little trick. :(

+1  A: 

Use the function: ValidatorValidate(val)

http://msdn.microsoft.com/en-us/library/aa479045.aspx

George
Nice, but do you have a way to get all validator(s) obj associated with the field dynamically. I don't want to hard code these scripts. I want the beautiful solution ( which I might not get )
BigBlondeViking
Thanks, you started me in the right direction.
BigBlondeViking
+1  A: 

Well looks like I answered my own question, with some help from George, and the intertubes.

After seeing this post: I looked at the DOM in Firebug and found the array of Validators. then it was a matter of getting the right ones, and calling the ValidatorValidate(validator) method.

   function callMyValidators() {
        // Clean Up Infragistics Ids
        var cleanid = this.id.replace(/^igtxt/i,"");


        for (var i = 0; i < Page_Validators.length; i++) {
            if (Page_Validators[i].controltovalidate === cleanid) {
                ValidatorValidate(Page_Validators[i]);
            }
        }

    }
BigBlondeViking