Knowledgebase Home Page  >  RapidSpell Web ASP.NET  >  Behavior Customization
Search the Knowledge Base
How do I check multiple text boxes with a MODAL popup?
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=39&catId=55

Options

Print this page
Email this to a friend
The RapidSpellWebMultiple control is great for checking multiple text boxes with non modal popups.  Modal popups work a little differently, but are simple to use to check multiple text boxes, with a little client side code.
 
The page below has two text boxes, each with their own RapidSpellWebLauncher control, note the important settings are in bold.  The Javascript function "runSpellCheck()" launches the spell checkers in succession, the parts in blue are dependent on the ID's given to the RapidSpellWebLaunchers in the code - if you have more than two text boxes, then you should add them to the array;
 
var rswlCntrls = ["<%=RapidSpellWebLauncher1.ClientID%>","<%=RapidSpellWebLauncher2.ClientID%>", "....ID3....", ...etc...];
 
Here is the complete page (the page is set as C#, but there isn't actually any difference between this and a VB version);
 
 
<%@ Register TagPrefix="rapidspellweb" Namespace="Com.Keyoti.RapidSpell" Assembly="Keyoti.RapidSpellWeb" %>
<%@ Page language="c#" AutoEventWireup="false"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>ModalMultiple</title>
  <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
  <meta name="CODE_LANGUAGE" Content="C#">
  <meta name="vs_defaultClientScript" content="JavaScript">
  <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  <script>
   function runSpellCheck(){
    var rswlCntrls = ["<%=RapidSpellWebLauncher1.ClientID%>","<%=RapidSpellWebLauncher2.ClientID%>"];
    for(var i=0; i<rswlCntrls.length; i++){
     eval("popUpCheckSpelling"+rswlCntrls[i]+"('rsTCInt"+rswlCntrls[i]+"')");
    }
   }

  </script>
 </HEAD>
 <body MS_POSITIONING="GridLayout">
  <form id="Form1" method="post" runat="server">
   <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 34px; POSITION: absolute; TOP: 36px" runat="server"></asp:TextBox>
   <asp:TextBox id="TextBox2" style="Z-INDEX: 102; LEFT: 34px; POSITION: absolute; TOP: 74px" runat="server"></asp:TextBox>
 
   <RapidSpellWeb:RapidSpellWebLauncher id="RapidSpellWebLauncher1" style="Z-INDEX: 103; LEFT: 228px; POSITION: absolute; TOP: 40px"
    runat="server" Modal="True" TextComponentName="TextBox1"
    RapidSpellWebPage="PopUp.aspx"
    ShowButton="False"
    ShowNoErrorsMessage="False"
    ShowFinishedMessage="False">

   </RapidSpellWeb:RapidSpellWebLauncher>
 
   <rapidspellweb:RapidSpellWebLauncher id="RapidSpellWebLauncher2" style="Z-INDEX: 104; LEFT: 229px; POSITION: absolute; TOP: 85px"
    runat="server" Modal="True"
    TextComponentName="TextBox2"
    RapidSpellWebPage="PopUp.aspx"
    ShowButton="False"
    ShowNoErrorsMessage="False"
    ShowFinishedMessage="False">

   </rapidspellweb:RapidSpellWebLauncher>
   
   <input type=button onclick="runSpellCheck()" value="Check Spelling" style="Z-INDEX: 101; LEFT: 34px; POSITION: absolute; TOP: 106px">
   
  </form>
 </body>
</HTML>

Related Questions:

Attachments:

No attachments were found.