Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Disable spell check for a textbox - RapidSpell Web ASP.NET - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
hamed
#1 Posted : Saturday, July 11, 2015 5:49:09 PM
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?

Jim
#2 Posted : Saturday, July 11, 2015 6:45:35 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
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!


hamed
#3 Posted : Saturday, July 11, 2015 6:47:05 PM
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
Jim
#4 Posted : Saturday, July 11, 2015 7:31:40 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
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!


hamed
#5 Posted : Saturday, July 11, 2015 7:56:48 PM
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


Jim
#6 Posted : Saturday, July 11, 2015 9:16:45 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
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!


hamed
#7 Posted : Saturday, July 11, 2015 11:49:43 PM
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
hamed
#8 Posted : Sunday, July 12, 2015 4:45:02 AM
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?
Jim
#9 Posted : Sunday, July 12, 2015 5:08:09 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
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!


hamed
#10 Posted : Sunday, July 12, 2015 6:23:48 PM
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

Jim
#11 Posted : Monday, July 13, 2015 4:07:19 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
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!


hamed
#12 Posted : Monday, July 13, 2015 1:57:22 PM
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
hamed
#13 Posted : Monday, July 13, 2015 2:07:19 PM
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
Jim
#14 Posted : Monday, July 13, 2015 6:26:49 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
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!


hamed
#15 Posted : Monday, July 13, 2015 6:44:29 PM
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
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.