|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
hi, i am trying to disable spell check for a textbox. I used the following line but i didnt work Code: rapidSpell.ayt_ignoreTextBoxIds[rapidSpell.ayt_ignoreTextBoxIds.length] = 'textbox1' Am i missing something?
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
The ID of the textbox inside the HTML is probably not actually textBox1. You probably need rapidSpell.ayt_ignoreTextBoxIds[rapidSpell.ayt_ignoreTextBoxIds.length] = '<%=textBox1.ClientID%>'; I think I corrected the capitalization based on your other post. Best Jim -your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
Jim wrote:The ID of the textbox inside the HTML is probably not actually textBox1.
You probably need
rapidSpell.ayt_ignoreTextBoxIds[rapidSpell.ayt_ignoreTextBoxIds.length] = '<%=textBox1.ClientID%>';
I think I corrected the capitalization based on your other post.
Best Jim
I did this but it didnt work
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
You'll need to show me some context to where you're calling that line. Also, please check the IDs in the rendered HTML match. -your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
Jim wrote:You'll need to show me some context to where you're calling that line. Also, please check the IDs in the rendered HTML match. here is the context: Code: <script type="text/javascript"> rapidSpell.ayt_ignoreTextBoxIds[rapidSpell.ayt_ignoreTextBoxIds.length] = '<%=textbox1.ClientID%>'; </script>
There is no error nor exceptions, but it is not disabled
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
You're sure it's not the browser's default spell checker running? Also, have you set this anywhere (you must not) rapidSpell.ayt_findByClass=true; If you set that true then it only checks textboxes with class='rsw_spellable' (you might want to try that too). If none of that helps, please email me (at support) the complete browser view source for your page. Thanks Jim -your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
Jim wrote:You're sure it's not the browser's default spell checker running?
Also, have you set this anywhere (you must not)
rapidSpell.ayt_findByClass=true;
If you set that true then it only checks textboxes with class='rsw_spellable' (you might want to try that too).
If none of that helps, please email me (at support) the complete browser view source for your page.
Thanks Jim No, my browser doesnt have default spell checker.when i add nospell=true for textbox, it throws an exception
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
Hi Jim, I tried it but i didnt work. I dont know why. I almost used all the possible ways. Last question the line for disabling the spell check has to be within javascript i used for controlling the scroll and enter key or within the rapidspell src javascript?
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
The way you had it above Code: <script type="text/javascript"> rapidSpell.ayt_ignoreTextBoxIds[rapidSpell.ayt_ignoreTextBoxIds.length] = '<%=textbox1.ClientID%>'; </script>
That should be fine, it just needs to run on the page, AFTER the RapidSpell-AYT.js import. If you can send me the full browser view source then I can check if there's a problem. Note that if you call the above too late, like for example in an onload handler, then it might not function because the spell check may have already setup. So, it should be called as early as possible. -your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
Jim wrote:The way you had it above Code: <script type="text/javascript"> rapidSpell.ayt_ignoreTextBoxIds[rapidSpell.ayt_ignoreTextBoxIds.length] = '<%=textbox1.ClientID%>'; </script>
That should be fine, it just needs to run on the page, AFTER the RapidSpell-AYT.js import. If you can send me the full browser view source then I can check if there's a problem. Note that if you call the above too late, like for example in an onload handler, then it might not function because the spell check may have already setup. So, it should be called as early as possible. i did it like this Code: <script type="text/javascript"> rapidSpell.ayt_ignoreTextBoxIds[rapidSpell.ayt_ignoreTextBoxIds.length] = '<%=chatbox.ClientID%>' rapidSpell.addEventListener('ayt_textboxesinitialized', function () { var MultiLinetextbox = document.getElementById('<%=chatbox.ClientID%>'); var ifr = rsw_getTBSFromTB(MultiLinetextbox).iframe.contentWindow.document.documentElement; ifr.scrollTop = ifr.scrollHeight; rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus(); } ); </script>
but it throws an expection in line Code: var ifr = rsw_getTBSFromTB(MultiLinetextbox).iframe.contentWindow.document.documentElement;
Also, i tried placing the rapidspell ignore whether at the beginnig or at the end of the function, it works fine but the spell checker is not disabled
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
The code block you posted won't work because you're telling it to ignore 'chatbox' and then you're treating it like it is NOT ignored. If you want to disable the spell checker on chatbox, then you don't need Code: var MultiLinetextbox = document.getElementById('<%=chatbox.ClientID%>'); var ifr = rsw_getTBSFromTB(MultiLinetextbox).iframe.contentWindow.document.documentElement; ifr.scrollTop = ifr.scrollHeight; rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();
you can just go back to the old focus code you had before. When the spell check is enabled for a textbox, it becomes an iframe, and you have to use our API sometimes to work with it. If spell check is not enabled then it remains a regular textbox and you can use normal DOM calls. -your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
Jim wrote:The code block you posted won't work because you're telling it to ignore 'chatbox' and then you're treating it like it is NOT ignored. If you want to disable the spell checker on chatbox, then you don't need Code: var MultiLinetextbox = document.getElementById('<%=chatbox.ClientID%>'); var ifr = rsw_getTBSFromTB(MultiLinetextbox).iframe.contentWindow.document.documentElement; ifr.scrollTop = ifr.scrollHeight; rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();
you can just go back to the old focus code you had before. When the spell check is enabled for a textbox, it becomes an iframe, and you have to use our API sometimes to work with it. If spell check is not enabled then it remains a regular textbox and you can use normal DOM calls. But this will cause the same problem with scrollbar and focus, because i want only to disable spell check for chat box not the typing textbox
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
I used the previous javascript code, it worked very well for all scrollbar, enter key and for disabling spell check bot the only problem the cursor focus didnt work. I used my previous code but the same problem
|
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
I see the problem - yes you still need this code for the focus Code: rapidSpell.addEventListener('ayt_textboxesinitialized', function () {
rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus(); } );
-your feedback is helpful to other users, thank you!
|
|
Rank: Member
Groups: Registered
Joined: 7/9/2015 Posts: 20 Location: United Kingdom
|
Jim wrote:I see the problem - yes you still need this code for the focus Code: rapidSpell.addEventListener('ayt_textboxesinitialized', function () {
rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus(); } );
Thank you a lot, it worked now
|
|