Knowledgebase Home Page  >  RapidSpell Web ASP.NET  >  Behavior Customization
Search the Knowledge Base
Setting the textbox to check in Javascript (RapidSpellWebLauncher)
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=192&catId=55

Options

Print this page
Email this to a friend

By implementing a custom interface you have the flexibility to decide which textbox is checked, using Javascript. This example implements the interface and uses two buttons to switch which textbox is to be checked, and then launch the checker.

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JSTextBoxSwitch.aspx.cs" Inherits="JSTextBoxSwitch" %>

<%@ Register TagPrefix="rapidspellweb" Namespace="Keyoti.RapidSpell" Assembly="Keyoti.RapidSpellWeb.ASP.NETv2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

<script>

var tbToCheck;

function RSCustomInterface(tbElementName){

this.tbName = tbElementName;

this.getText = getText;

this.setText = setText;

function getText(){

//return the text from the text component named

return tbToCheck.value;

}

function setText(text){

//set the text in the text component to the text argument

tbToCheck.value=text;

}

}

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:TextBox id="tb1" runat="server" />

<asp:TextBox id="tb2" runat="server" />

<rapidspellweb:RapidSpellWebLauncher runat="server" RapidSpellWebPage="PopUp.aspx"

TextComponentInterface="Custom"

id="RapidSpellWebLauncher1"

ShowButton="false"

/>

<input type="button" value="tb1" onclick="tbToCheck=document.getElementById('tb1');<%=

RapidSpellWebLauncher1.ClientSideObject %>.OnSpellButtonClicked(); " />

<input type="button" value="tb1" onclick="tbToCheck=document.getElementById('tb2');<%=

RapidSpellWebLauncher1.ClientSideObject %>.OnSpellButtonClicked(); " />

</div>

</form>

</body>

</html>

 

 

 


Related Questions:

Attachments:

No attachments were found.