Knowledgebase Home Page  >  RapidSpell Web Java
Search the Knowledge Base
How can I trigger the onchange event listener when the spell checker changes the text in my textbox?
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=172&catId=45

Options

Print this page
Email this to a friend
The onchange handler is only usually called when the user makes changes and leaves the text box.  If you would like it to be called when the spell checker makes changes as well, do the following.

1. Set textComponentInterface in RapidSpellWebLauncher to "CUSTOM"
 
2. Add this to your page
 
<script>
function RSCustomInterface(tbElementName){
 this.tbName = tbElementName;this.getText = getText;
 this.setText = setText;
 function getText(){ 
  return eval('document.'+this.tbName+'.value');
 }
 function setText(text){ 
  var oldText = this.getText();
  eval('document.'+this.tbName+'.value = text') ;
  if(oldText!=text){
   eval('document.'+this.tbName+'.onchange.call()');
  }
 
 }
}
</script>
 
which will call the onchange function when the corrected text is different to the original text.
 
NOTE: the callBack attribute has been deprecated and must not be set in order for this to work.

Related Questions:

Attachments:

No attachments were found.