I have several (about 15) radiobuttonlists on a page. I want to do all client validation (at least in this exercise) with the rule that each radiobuttonlist on the page needs to have a selected item.
Also want a validatorCallout associated with each radiobuttonlist to be called.
Initially wanted to use a central customvalidator, but it appears the one-to-one relationship between the CV and the control to validate will not allow one customvalidator to be reused for the whole page and associated with several possible controls to validate (as well as several separate callout extenders with custom messages).
I see documentation that shows the second argument for the customvalidator clientscript passes args which has a Value property pointing to the controlTo Validate. However, my Value property is always null. I also see references that the Value argument is only applicable to server validation, not client. But then other places say both.
Want to centralize one JavaScript function that can be called by multiple customValidator controls and pass in a ref to the particular radiobuttonlist to validate without writing lost of nearly-redundant versions for each.
Questions:
1. Does the client functions second argument (typically args) contain a Value property which references the original control being validated?
2. Is it possible to call just ONE customvalidator function on the page and pass in the control (radiobuttonlist in this case) to validate? Once I get the ref to the radiobuttonlist, I'll be fine (I know how to walk through the list in JS to see if one is checked-just need a valid ref in the function to start it all off)
I don't necessarily mind having 15 customvalidators and 15 validatorextenders defined for the 15 radiobuttonlists. But it seems silly to then also have 15 separate (and identical except for the name of the radiobuttonlist) JavaScript functions on the page being used by the customvalidator controls...
Ideas?
Source Click Here.
No comments:
Post a Comment
Post your comments here: