We have a need to fire a spell check before an email gets sent out. The idea being, user clicks “Send” and once the spellcheck is complete, it would send without further interaction. This works with the following script very well. The only issue we have is that is distinguishing between whether the user clicked on “Cancel” on the spellchecker in RadEditor or the spell check completed. When the user clicks Cancel, we don’t want to send the email.
Is there any way to know what condition fired the function attached to add_spellCheckEnd ? Or an alternative method?
<script type="text/javascript">
function SpellCheckAndSubmit() {
var editor = $find("<%=textEdit.RadEditorClientID%>");
var sendButton = document.getElementById("<%=btnSendEmail.ClientID%>");
editor.fire("AjaxSpellCheck");
setTimeout(function() {
var spell = editor.get_ajaxSpellCheck();
spell.add_spellCheckEnd(function(sender, args) {
//if Cancelled Button Hit
//Do nothing
//else
//Do Event
sendButton.click();
});
}, 100);
return false;
}
</script>
Any help you can provide would be appreciated.
Thanks
Martin Cheverall