// This functions sets up the validatorsfunction setValidator() { // Get the validator we created var val = getSpanByName("wtMySelectValidatorType"); // Add it to the page validators Page_Validators.push(val); // Register the new validator ValidatorOnLoad();}
// This is the function that implements the custom validatorfunction mySelectCustomValidator (source, arguments) { // Get the field object var objField = document.all[source.controltovalidate]; // Check if the object value is greater than "Right" arguments.IsValid = objField.options[objField.selectedIndex].text == "Right";}
// This is a helper function, to get the correct spanfunction getSpanByName(spanName) { var spans = document.getElementsByTagName("SPAN"); var i; for (i=0; i < spans.length; i++) { if (spans[i].name == spanName) { return spans[i]; } }}