I have written a Sharepoint 2007 web part which requires validation in both the User form, and the Admin form (EditorPart).
I am using InputFormRegularEdpressionValidator to do the validation like this:
tb = new TextBox();
tb.ID = "myID";
InputFormRegularExpressionValidator validTb = new
InputFormRegularExpressionValidator();
validTb.ControlToValidate = tb.ID;
validTb.ValidationExpression = myRegExp;
validTb.ValidationGroup = "AdminInput";
this.Controls.Add(tb);
this.Controls.Add(validTb);
I have defined two validation groups - one for the UserInput and the other for AdminInput. I defined a submit button in the user form, and set this ValidationGroup to UserInput,
However, I can't figure out how to apply the ValidationGroup AdminInput to the Ok and Apply buttons in the Editor part, or otherwise validate these fields.
How does one trigger validtion of EditorPart fields on clicking Ok/Apply separately from validation of fields in the public facing web part?