Knowledgebase Home Page  >  RapidSpell Web ASP.NET  >  Rich/HTML Textboxes
Search the Knowledge Base
How do I check multiple PowerWEB TextBox controls on one page.
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=55&catId=56

Options

Print this page
Email this to a friend
Assuming you already have your page set up, with a RapidSpellWebLauncher for each text box, and a RapidSpellWebMultiple to join them all together (if you haven't go this far, please consult the docs and example projects for guidance on this) - but have found that when running the spell check it only checks the text in one text box repeatedly.  The problem is caused because the built-in interface we use for PowerWEB switches to the currently active text box, there for to override this behavior please follow these steps.
 
[In the page where you have the text boxes]
 
1. Add this Javascript to your page
 
<script type="text/javascript">
function RSCustomInterface(tbElementName){
this.getText = getText;
this.setText = setText;
this.tbElementName = tbElementName;
function getText(){
 if(document.getElementById(this.tbElementName).contentWindow)
  return document.getElementById(this.tbElementName).contentWindow.document.body.innerHTML;
 else
  return document.getElementById(this.tbElementName).innerHTML;
}
function setText(text){
 if(document.getElementById(this.tbElementName).contentWindow)
  document.getElementById(this.tbElementName).contentWindow.document.body.innerHTML = text;
 else
  document.getElementById(this.tbElementName).innerHTML = text;
}
 
}
</script>
2. Set TextComponentInterface to "Custom" in all instances of RapidSpellWebLauncher, (so that they use the Javascript in step 1).
 
3. In each RapidSpellWebLauncher, set TextComponentName to "<%# HtmlBox1.TextWindow.ClientID %>" - where "HtmlBox1" corresponds to the ID of the PowerWEB TextBox that it should spell check
 
4. Add "Page.DataBind()" to the Page_Load method for the page, eg. in code behind;
 

private void Page_Load(object sender, System.EventArgs e)

{

// Put user code to initialize the page here

Page.DataBind();

}


Related Questions:

Attachments:

No attachments were found.