G
Guest
Hi All,
I have a repeater that required a check box on each item in the repeater to
be validated against eachother (to check if only one item's checkbox is
ticked.) To perform this validation I created a validation control that
inherits from BaseValidator and performs server and client side checks and is
performing the validation on the repeater control.
The above all works except I cant get the client validation to stop the page
from submitting - it does not call the validation function for the control.
I have added code such as:
AddAttributesToRender { ...
writer.AddAttribute("evaluationfunction", "CheckAllCheckBoxes" +
this.ClientID);
....
}
or
RegisterValidatorDeclaration {
...
string element = "document.getElementById(\"" + this.ClientID + "\")";
Page.RegisterArrayDeclaration("Page_Validators", element);
...
}
Neither seem to enable the client script to be run when the submit button is
pressed.
Please help
I have a repeater that required a check box on each item in the repeater to
be validated against eachother (to check if only one item's checkbox is
ticked.) To perform this validation I created a validation control that
inherits from BaseValidator and performs server and client side checks and is
performing the validation on the repeater control.
The above all works except I cant get the client validation to stop the page
from submitting - it does not call the validation function for the control.
I have added code such as:
AddAttributesToRender { ...
writer.AddAttribute("evaluationfunction", "CheckAllCheckBoxes" +
this.ClientID);
....
}
or
RegisterValidatorDeclaration {
...
string element = "document.getElementById(\"" + this.ClientID + "\")";
Page.RegisterArrayDeclaration("Page_Validators", element);
...
}
Neither seem to enable the client script to be run when the submit button is
pressed.
Please help