Using the dialog spell checker as a client-side validator.
rapidSpell.ayt_aytEnabled = false;//disable inline checking
rapidSpell.ayt_staticMode = true; //disable inline checking
function validateSpelling(oSrc, args) {
//Check if spell check already ran.
for (var i = 0; i < rsw_rapidSpellControls.length; i++) {
if (rsTCInt[rsw_rapidSpellControls[i]].tbName == oSrc.controltovalidate && rsTCInt[rsw_rapidSpellControls[i]].hasRun) {
args.IsValid = true;
return;
}
}
//we import RapidSpell-AYT.js to be able to use RapidSpellCheckerClient
var rapidSpellChecker = new RapidSpellCheckerClient(rapidSpell.ayt_helperURL);
rapidSpellChecker.config = rsw_getConfigurationObject('default');
var result = rapidSpellChecker.Check(args.Value);
args.IsValid = result.numberOfErrors == 0;
}
<asp:CustomValidator id="CustomValidator1" runat="server" ControlToValidate="TextBox1" EnableClientScript='true'
ErrorMessage="There are spelling errors and spell check hasn't been performed."
ClientValidationFunction="validateSpelling">
</asp:CustomValidator>