|
Rank: Member
Groups: Registered
Joined: 10/6/2014 Posts: 7
|
Hi
I am trying to implement Inline Spell Check with Ajax Tabs in .net 4.0.
Can you please share any sample implementation of Inline Spell Check with Ajax Container and Tabs ?
Or may be point me to any support forum question that may have that implementation.
My requirement is to spell check all tabs all textboxes on a button click.
Regards M
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Hi, I'll have an example for you a little later today. Jim -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
This code does what you're asking; Code: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TabsDialog.aspx.cs" Inherits="RSWEB_JS.RegressionTests.inline.TabsDialog" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="../../Scripts/RapidSpell-DIALOG.js"></script> <script type="text/javascript"> function spellTabs(recursed) { if (!recursed) $find('tabContainer').set_activeTabIndex(0); var inputs = $find('tabContainer')._tabs[$find('tabContainer')._activeTabIndex]._element.getElementsByTagName('input'); var textareas = $find('tabContainer')._tabs[$find('tabContainer')._activeTabIndex]._element.getElementsByTagName('textarea'); var textboxes = []; for (var i = 0; i < inputs.length; i++) { if(inputs[i].type=='text') textboxes[textboxes.length] = inputs[i].id; } for (var i = 0; i < textareas.length; i++) textboxes[textboxes.length] = textareas[i].id;
if (!recursed) { rapidSpell.addEventListener('dialog_finishedcheckingall', function (a, b, complete) { if (complete && tabContainer.control.get_activeTab()._tabIndex < tabContainer.control._tabs.length - 1) { $find('tabContainer').set_activeTabIndex(tabContainer.control.get_activeTab()._tabIndex + 1); setTimeout(function () { spellTabs(true) }, 1000); } }); } rapidSpell.setParameterValue('default', 'ShowFinishedMessage', tabContainer.control.get_activeTab()._tabIndex == tabContainer.control._tabs.length-1); rapidSpell.dialog_spellCheck(true, textboxes);//check everything that is visible
}
</script> </head> <body> <form id="form1" runat="server"> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager> <div> <ajaxToolkit:TabContainer runat="server" id="tabContainer" OnDemand="True" Height="150px"> <ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="tab1"> <ContentTemplate> tab1 <asp:TextBox runat="server" ID="tb1">thiiss is tbab1</asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="tab2"> <ContentTemplate> tab2 <asp:TextBox runat="server" ID="TextBox1">and tbab2</asp:TextBox> <asp:TextBox TextMode="MultiLine" runat="server" ID="TextBox2">this is a multiliner</asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="tab3"> <ContentTemplate> tab3 <asp:TextBox runat="server" ID="TextBox3">xyz</asp:TextBox> <asp:TextBox TextMode="MultiLine" runat="server" ID="TextBox4">ghi</asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <input type="button" onclick="spellTabs(false)" value="Spell" /> </div> </form> </body> </html>
I believe the JS chunk at the top will work with any tabcontainer setup, but there's one bit of code that is not ideal; setTimeout(function () { spellTabs(true) }, 1000); this was used because you have to wait for the tab content to load before trying to spell check it. I don't know if there's an event that would work better, perhaps you do? Best Jim -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 10/6/2014 Posts: 7
|
Thanks so much Jim for your prompt reply.
Can you please help me with an implementation of inLine Spell Check for all tabs all textboxes ? i.e. on click of 'Check Spelling' button, it should underline all incorrect words red in all the textboxes under all the tabs.
The one you provided uses Dialog mode.
Appreciate all the help.
Thanks Mohammad
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Sorry Mohammad, you did say 'inline' in your original post and I missed it. I need to ask, do you want the inline spell checking to be 'static' (so the user cannot edit the text when the underlines are shown) or do you want it to be 'dynamic' (the user can edit while underlines are shown)? Also have you considered using as-you-type mode checking? Jim -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 10/6/2014 Posts: 7
|
Hi Jim,
I would like inline spell checking to be dynamic.
Thanks
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Thanks, here you go Code: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TabsINline.aspx.cs" Inherits="RSWEB_JS.RegressionTests.inline.TabsInline" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="../../Scripts/RapidSpell-AYT.js"></script> <script type="text/javascript"> rapidSpell.ayt_aytEnabled = false; var isChecking = false; var tbPtr = 0; var textboxes; function onTabChanged() { if (isChecking) setTimeout(function () { rapidSpell.ayt_spellCheck(); }, 1000); }
function spellTabs(recursed) {
var inputs = $find('tabContainer')._tabs[$find('tabContainer')._activeTabIndex]._element.getElementsByTagName('input'); var textareas = $find('tabContainer')._tabs[$find('tabContainer')._activeTabIndex]._element.getElementsByTagName('textarea'); textboxes = []; for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == 'text') textboxes[textboxes.length] = inputs[i].id; } for (var i = 0; i < textareas.length; i++) textboxes[textboxes.length] = textareas[i].id;
rapidSpell.addEventListener('ayt_spellcheckfinish', function () { tbPtr++; startSpell(); }); tbPtr = 0; startSpell(); }
function startSpell() { if(tbPtr<textboxes.length) rapidSpell.ayt_spellCheck(textboxes[tbPtr]); }
function tabChange() { if(isChecking) setTimeout(function () { spellTabs(); }, 1000); }
</script> </head> <body> <form id="form1" runat="server"> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager> <div> <ajaxToolkit:TabContainer runat="server" id="tabContainer" OnDemand="True" OnClientActiveTabChanged="tabChange" Onc Height="150px"> <ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="tab1"> <ContentTemplate> tab1 <asp:TextBox runat="server" ID="tb1">thiiss is tbab1</asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="tab2"> <ContentTemplate> tab2 <asp:TextBox runat="server" ID="TextBox1">and tbab2</asp:TextBox> <asp:TextBox TextMode="MultiLine" runat="server" ID="TextBox2">this is a multiliner</asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="tab3"> <ContentTemplate> tab3 <asp:TextBox runat="server" ID="TextBox3">xyz</asp:TextBox> <asp:TextBox TextMode="MultiLine" runat="server" ID="TextBox4">ghi</asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <input type="button" onclick="isChecking = !isChecking; spellTabs();" value="Spell" /> </div> </form> </body> </html>
-your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 10/6/2014 Posts: 7
|
Thanks Jim for the code snippet. It works.
|
|
Rank: Member
Groups: Registered
Joined: 10/6/2014 Posts: 7
|
Hi Jim,
It seems to fail for tabs that has more than 2 Input Textboxes and TextAreas.
I tried it with multiple textboxes and textareas. It performs check for some textboxes/textareas but not all present on the tab. Find my code snippet below. Please let me know if i am missing anything.
<script src="SpellChek/RapidSpell-AYT.js" type="text/javascript"></script> <script type="text/javascript"> rapidSpell.ayt_aytEnabled = false; var isChecking = false; var tbPtr = 0; var textboxes; function onTabChanged() { if (isChecking) setTimeout(function () { rapidSpell.ayt_spellCheck(); }, 1000); }
function spellTabs(recursed) { // debugger; var inputs = $find('ctl00_Body_Tabs')._tabs[$find('ctl00_Body_Tabs')._activeTabIndex]._element.getElementsByTagName('input'); var textareas = $find('ctl00_Body_Tabs')._tabs[$find('ctl00_Body_Tabs')._activeTabIndex]._element.getElementsByTagName('textarea'); textboxes = []; for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == 'text') textboxes[textboxes.length] = inputs[i].id; } for (var i = 0; i < textareas.length; i++) textboxes[textboxes.length] = textareas[i].id;
rapidSpell.addEventListener('ayt_spellcheckfinish', function () { tbPtr++; startSpell(); }); tbPtr = 0; startSpell(); }
function startSpell() { if (tbPtr < textboxes.length) rapidSpell.ayt_spellCheck(textboxes[tbPtr]); }
function tabChange() { if (isChecking) setTimeout(function () { spellTabs(); }, 1000); }
</script> <asp:UpdatePanel ID="uiPageUpdate" runat="server"> <ContentTemplate> <ajaxToolkit:TabContainer runat="server" ID="Tabs" Height="600px" ScrollBars="Vertical" OnClientActiveTabChanged="tabChange" > <ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="Tab1"> <ContentTemplate> Tab1 TextArea:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="uiTab1Text" runat="server" Columns="75" Height="153px" Rows="2" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br /> Tab1 TextBox1:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox6" runat="server" Columns="75" Height="153px" Rows="2" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br /> Tab1 TextBox2:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox7" runat="server" Columns="75" Height="153px" Rows="2" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextBox3:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox8" runat="server" Columns="75" Height="153px" Rows="2" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextBox4:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox9" runat="server" Columns="75" Height="153px" Rows="2" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextBox5:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox10" runat="server" Columns="75" Height="153px" Rows="2" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextBox6:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox11" runat="server" Columns="75" Height="153px" Rows="2" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextArea1:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox12" runat="server" Columns="75" Height="153px" Rows="2" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextArea2:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox13" runat="server" Columns="75" Height="153px" Rows="2" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextArea3:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox14" runat="server" Columns="75" Height="153px" Rows="2" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextArea4:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox15" runat="server" Columns="75" Height="153px" Rows="2" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox>
<br /> Tab1 TextArea5:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox16" runat="server" Columns="75" Height="153px" Rows="2" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel2" HeaderText="Tab2"> <ContentTemplate> <asp:Panel ID="Test" runat="server"> Tab2 Text:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="uiTab2Text" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> </asp:Panel> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel3" HeaderText="Tab3"> <ContentTemplate> Tab3 Text: <br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="uiTab3Text" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br /> Tab3 Text2:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="uiTab3Text2" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br />
Tab3 Text3:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox1" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br />
Tab3 Text4:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox2" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br />
Tab3 Text5:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox3" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br />
Tab3 Text6:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox4" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br />
Tab3 Text7:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="RapidSpellWInlineTextBox5" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> <br /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel4" HeaderText="Tab4"> <ContentTemplate> Tab4 Text:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="uiTab4Text" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel5" HeaderText="Tab5"> <ContentTemplate> Tab5 Text:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="uiTab5Text" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="tabnts" HeaderText="Tab5"> <ContentTemplate> Tab5:<br /> <RapidSpellWeb:RapidSpellWInlineTextBox ID="uiTab6Text" runat="server" Columns="75" Height="153px" Rows="5" TextMode="MultiLine" Width="656px"></RapidSpellWeb:RapidSpellWInlineTextBox> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <center> <div>
<asp:Button ID="btReview" runat="server" OnClientClick="isChecking = !isChecking; spellTabs();" Text="Spell Check" /> </div> </center> </ContentTemplate> </asp:UpdatePanel> </asp:Content>
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Hi, you shouldn't need to, and in fact you shouldn't use any of our ASP.NET controls (eg RapidSpellWeb:RapidSpellWInlineTextBox) when you're using the "JS mode" style of usage. I.e. if you import RapidSpell-AYT.js or RapidSpell-DIALOG.js then you should just use regular textboxes, not our textbox controls. You can see in my example I used asp:TextBox but you can also use textarea or input type=text. It's possible that this will resolve it for you. Best Jim -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 10/6/2014 Posts: 7
|
Hi Jim,
I tried with regular textboxes (i.e. asp:TextBox ), however it doesn't fix the problem. It performs check for some textboxes/textareas but not all present on the tab.
Find the code snippet below.
<script src="SpellChek/RapidSpell-AYT.js" type="text/javascript"></script> <script type="text/javascript"> rapidSpell.ayt_aytEnabled = false; var isChecking = false; var tbPtr = 0; var textboxes; function onTabChanged() { if (isChecking) setTimeout(function () { rapidSpell.ayt_spellCheck(); }, 1000); }
function spellTabs(recursed) { var inputs = $find('ctl00_Body_Tabs')._tabs[$find('ctl00_Body_Tabs')._activeTabIndex]._element.getElementsByTagName('input'); var textareas = $find('ctl00_Body_Tabs')._tabs[$find('ctl00_Body_Tabs')._activeTabIndex]._element.getElementsByTagName('textarea'); textboxes = []; for (var i = 0; i < inputs.length; i++) { if (inputs[i].type == 'text') textboxes[textboxes.length] = inputs[i].id;
if (inputs[i].type == 'textarea') textboxes[textboxes.length] = inputs[i].id; } for (var i = 0; i < textareas.length; i++) textboxes[textboxes.length] = textareas[i].id;
rapidSpell.addEventListener('ayt_spellcheckfinish', function () { tbPtr++; startSpell(); }); tbPtr = 0; startSpell(); }
function startSpell() { if (tbPtr < textboxes.length) rapidSpell.ayt_spellCheck(textboxes[tbPtr]); }
function tabChange() { if (isChecking) setTimeout(function () { spellTabs(); }, 1000); }
</script> <asp:UpdatePanel ID="uiPageUpdate" runat="server"> <ContentTemplate> <ajaxToolkit:TabContainer runat="server" ID="Tabs" Height="600px" ScrollBars="Vertical" OnClientActiveTabChanged="tabChange" > <ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="Tab1"> <ContentTemplate> Tab1 TextArea:<br /> <asp:TextBox ID="txtB1" runat="server" TextMode="MultiLine" ></asp:TextBox> <br /> Tab1 TextBox1:<br /> <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> <br /> Tab1 TextBox2:<br /> <asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox>
<br /> Tab1 TextBox3:<br /> <asp:TextBox ID="TextBox3" runat="server" ></asp:TextBox>
<br /> Tab1 TextBox4:<br /> <asp:TextBox ID="TextBox4" runat="server" ></asp:TextBox>
<br /> Tab1 TextBox5:<br /> <asp:TextBox ID="TextBox5" runat="server" ></asp:TextBox>
<br /> Tab1 TextBox6:<br /> <asp:TextBox ID="TextBox6" runat="server" ></asp:TextBox>
<br /> Tab1 TextArea1:<br /> <asp:TextBox ID="TextBox7" runat="server" TextMode="MultiLine" ></asp:TextBox>
<br /> Tab1 TextArea2:<br /> <asp:TextBox ID="TextBox8" runat="server" TextMode="MultiLine" ></asp:TextBox>
<br /> Tab1 TextArea3:<br /> <asp:TextBox ID="TextBox9" runat="server" TextMode="MultiLine" ></asp:TextBox>
<br /> Tab1 TextArea4:<br /> <asp:TextBox ID="TextBox10" runat="server" TextMode="MultiLine" ></asp:TextBox>
<br /> Tab1 TextArea5:<br /> <asp:TextBox ID="TextBox11" runat="server" TextMode="MultiLine" ></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel2" HeaderText="Tab2"> <ContentTemplate> <asp:Panel ID="Test" runat="server"> Tab2 Text:<br /> <asp:TextBox ID="TextBox12" runat="server" TextMode="MultiLine" ></asp:TextBox> </asp:Panel> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel3" HeaderText="Tab3"> <ContentTemplate> Tab3 Text:<br /> <asp:TextBox ID="TextBox13" runat="server" TextMode="MultiLine" ></asp:TextBox> <br /> <br /> Tab3 Text2:<br /> <asp:TextBox ID="TextBox14" runat="server" TextMode="MultiLine" ></asp:TextBox> <br />
Tab3 Text3:<br /> <asp:TextBox ID="TextBox15" runat="server" TextMode="MultiLine" ></asp:TextBox> <br />
Tab3 Text4:<br /> <asp:TextBox ID="TextBox16" runat="server" TextMode="MultiLine" ></asp:TextBox> <br />
Tab3 Text5:<br /> <asp:TextBox ID="TextBox17" runat="server" TextMode="MultiLine" ></asp:TextBox> <br />
Tab3 Text6:<br /> <asp:TextBox ID="TextBox18" runat="server" TextMode="MultiLine" ></asp:TextBox> <br />
Tab3 Text7:<br /> <asp:TextBox ID="TextBox19" runat="server" TextMode="MultiLine" ></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel4" HeaderText="Tab4"> <ContentTemplate> Tab4 Text:<br /> <asp:TextBox ID="TextBox20" runat="server" TextMode="MultiLine" ></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="TabPanel5" HeaderText="Tab5"> <ContentTemplate> Tab5 Text:<br /> <asp:TextBox ID="TextBox21" runat="server" TextMode="MultiLine" ></asp:TextBox> <br /> Tab5 Text2:<br /> <asp:TextBox ID="TextBox23" runat="server" TextMode="MultiLine" ></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel runat="server" ID="tt" HeaderText="Tab6"> <ContentTemplate> Tab:<br /> <asp:TextBox ID="TextBox22" runat="server" TextMode="MultiLine" ></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <center> <div>
<asp:Button ID="btReview" runat="server" OnClientClick="isChecking = !isChecking; spellTabs();" Text="Spell Check" /> </div> </center> </ContentTemplate> </asp:UpdatePanel> </asp:Content>
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
You just need to add this flag; addedEventListener Code: <b> var addedEventListener = false;</b> function spellTabs(recursed) {
var inputs = $find('tabContainer')._tabs[$find('tabContainer')._activeTabIndex]._element.getElementsByTagName('input'); var textareas = $find('tabContainer')._tabs[$find('tabContainer')._activeTabIndex]._element.getElementsByTagName('textarea'); textboxes = []; for (var i = 0; i < inputs.length; i++) { if (inputs<i>.type == 'text') textboxes[textboxes.length] = inputs[i].id; } for (var i = 0; i < textareas.length; i++) textboxes[textboxes.length] = textareas[i].id;
<b> if (!addedEventListener) { addedEventListener = true;</b> rapidSpell.addEventListener('ayt_spellcheckfinish', function () { tbPtr++; startSpell(); }); } tbPtr = 0; startSpell(); }
[i]-your feedback is helpful to other users, thank you! -your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 10/6/2014 Posts: 7
|
Hi Jim, Appreciate your prompt replies and solutions. It seems to work fine now for more than 2 textboxes/text areas. However, I noticed a new issue. After I perform, spell check by clicking the Spell Check button and start visiting the tabs. If I revisit the already visited tabs, then it loses spell check underlines. Let me explain in detail the issue I face. Say I have 2 tabs and a Spell check click button. I fill textboxes/text areas in both the tabs and click spell check button. So, when I visit a tab for the first time, I see spelled check words as underlined. However, If I revisit the same tab second time, it loses its spelled check words underlines. If I revisit again the same tab for the Third time, I see spelled checked words as underlined. Sometimes it happens for some tabs, sometimes it doesn’t. It keeps switching on/off. Do I need to add anymore flags? Let me know if you need any further details.
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Sorry, I can't reproduce it, but I guess it's just not going to work the way you want. One option is as-you-type, or to use dialog per my original response. Jim -your feedback is helpful to other users, thank you!-your feedback is helpful to other users, thank you!
|
|