function msoxd_my_Age::OnValidate(eventObj)
{
// Clear any previous errors for this node.
XDocument.Errors.Delete(eventObj.Site,"InvalidValue");
//Set the valAge variable to the value that is entered in the Age field.
var valAge = parseInt(eventObj.Site.text);
//If the value that is entered in the Age field is less than 30 or
//greater than 65, add a passive error to the collection of the error.
if ((valAge < 30) || (valAge > 65))
{
XDocument.Errors.Add(eventObj.Site,"InvalidValue","The value of the "
+ eventObj.Site.baseName + " field must be greater than 30 and less than 65.");
}
}