Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Issue with textbox and javascript - RapidSpell Web ASP.NET - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
hamed
#1 Posted : Thursday, July 9, 2015 12:46:24 AM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Hi there,
I am using Rapidspell v4 for .net 4.5 in my asp.net application. I have already written a script
to control the scrollbar but It conflicts with rapid spell javascripts. When i add the scrollbar javascript, the spelling checher stopped and work when removing it. Another point, i use enter to send a text but it stopped working when the rapidspell is on. I hope you help me to solve these issues.
Jim
#2 Posted : Thursday, July 9, 2015 4:10:06 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi, are you using a window.onload handler in your script or page? If so you must explicitly call any existing onload handlers (ours) when yours runs. Let me know and I'll show you how.

If not, please create and send a mockup page the demonstrates the problem.

>Another point, i use enter to send a text but it stopped working when the rapidspell is on

Please include that code in your mockup too, or post it.

Thanks
Jim


-your feedback is helpful to other users, thank you!


hamed
#3 Posted : Thursday, July 9, 2015 10:46:43 AM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
Hi, are you using a window.onload handler in your script or page? If so you must explicitly call any existing onload handlers (ours) when yours runs. Let me know and I'll show you how.

If not, please create and send a mockup page the demonstrates the problem.

>Another point, i use enter to send a text but it stopped working when the rapidspell is on

Please include that code in your mockup too, or post it.

Thanks
Jim



Yes, i am using window.onload.When i stop spell checking, it works fine even for cusor focus and pressing enter to send a text. It like there is a conflict and every time i have to press send button instead of keyboard enter. Enabling scrollbar javascript will deactivate the spell checker

Regards
Jim
#4 Posted : Thursday, July 9, 2015 4:16:01 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Eg. if this is you onload code

Code:

<script type="text/javascript">
                        window.onload = function () {
                            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
                            MultiLinetextbox.scrollTop = MultiLinetextbox.scrollHeight;
                        }
                    </script>


change it to

Code:

<script type="text/javascript">
                        var existingOnload = window.onload;
                        window.onload = function () {
if(typeof(existingOnload)=='function')existingOnload ();
                            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
                            MultiLinetextbox.scrollTop = MultiLinetextbox.scrollHeight;
                        }
                    </script>


Regarding the pressing "enter" issue, please post the code for how you hook up and handle the key events, so I can answer you properly.

Jim
-your feedback is helpful to other users, thank you!


hamed
#5 Posted : Thursday, July 9, 2015 5:03:59 PM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
Eg. if this is you onload code

Code:

<script type="text/javascript">
                        window.onload = function () {
                            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
                            MultiLinetextbox.scrollTop = MultiLinetextbox.scrollHeight;
                        }
                    </script>


change it to

Code:

<script type="text/javascript">
                        var existingOnload = window.onload;
                        window.onload = function () {
if(typeof(existingOnload)=='function')existingOnload ();
                            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
                            MultiLinetextbox.scrollTop = MultiLinetextbox.scrollHeight;
                        }
                    </script>


Regarding the pressing "enter" issue, please post the code for how you hook up and handle the key events, so I can answer you properly.

Jim


I tried it but it didn't work, the scrollbar is not automatically pointed to the bottom. For enter issue, It was automatically appears in the textbox but now i have to click it every time i want to send something. I used only one line of code

Code:

textbox1.Focus();
]

Thank you
Jim
#6 Posted : Thursday, July 9, 2015 5:09:34 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
I'll get back to you regarding scrollTop, I can see the problem.

Please give me more context around "textbox1.Focus();"? Is that in an event handler? Which event handler, please just paste as much code as you can.

Or am I not understanding this? You mentioned pressing Enter, but I don't see how that relates to .focus()?
-your feedback is helpful to other users, thank you!


hamed
#7 Posted : Thursday, July 9, 2015 5:21:32 PM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
I'll get back to you regarding scrollTop, I can see the problem.

Please give me more context around "textbox1.Focus();"? Is that in an event handler? Which event handler, please just paste as much code as you can.

Or am I not understanding this? You mentioned pressing Enter, but I don't see how that relates to .focus()?


Code:

  protected void Page_Load(object sender, EventArgs e)
        {
            textbox1.Focus();
        }


the above line will only focus the cursor in the textbox every time i run the application which means i dont have to click to textbox to show the cursor point, it will be displayed automatically whether when i run the application or when i send text. Imagine sending text to chat box with multi textbox, i want to enable the cursor to be shown automatically and i can send text by either clicking the send button or enter of keyboard.
Thank you
Jim
#8 Posted : Thursday, July 9, 2015 7:07:59 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Please change this code
Code:

<script type="text/javascript">
                        var existingOnload = window.onload;
                        window.onload = function () {
if(typeof(existingOnload)=='function')existingOnload ();
                            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
                            MultiLinetextbox.scrollTop = MultiLinetextbox.scrollHeight;
                        }
                    </script>



to


Code:

<script type="text/javascript">
         rapidSpell.addEventListener('ayt_textboxesinitialized', function () {
            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
            var ifr = rsw_getTBSFromTB(MultiLinetextbox).iframe.contentWindow.document.documentElement;
            ifr.scrollTop = ifr.scrollHeight;
            rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();
        }
        );
                    </script>



you no longer need

Code:

protected void Page_Load(object sender, EventArgs e)
        {
            textbox1.Focus();
        }


Any problems let me know.
Jim
-your feedback is helpful to other users, thank you!


hamed
#9 Posted : Thursday, July 9, 2015 7:50:10 PM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
Please change this code
Code:

<script type="text/javascript">
                        var existingOnload = window.onload;
                        window.onload = function () {
if(typeof(existingOnload)=='function')existingOnload ();
                            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
                            MultiLinetextbox.scrollTop = MultiLinetextbox.scrollHeight;
                        }
                    </script>



to


Code:

<script type="text/javascript">
         rapidSpell.addEventListener('ayt_textboxesinitialized', function () {
            var MultiLinetextbox = document.getElementById('<%=chattingTxt.ClientID%>');
            var ifr = rsw_getTBSFromTB(MultiLinetextbox).iframe.contentWindow.document.documentElement;
            ifr.scrollTop = ifr.scrollHeight;
            rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();
        }
        );
                    </script>



you no longer need

Code:

protected void Page_Load(object sender, EventArgs e)
        {
            textbox1.Focus();
        }


Any problems let me know.
Jim



It threw an exception in the following line
Code:
rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();

its number is 0x800a138f


Jim
#10 Posted : Thursday, July 9, 2015 9:35:45 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Can you see in your rendered HTML if
rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();

was rendered with the actual ID for textBox1? Hope you know what I mean.
-your feedback is helpful to other users, thank you!


hamed
#11 Posted : Thursday, July 9, 2015 11:34:56 PM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
Can you see in your rendered HTML if
rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();

was rendered with the actual ID for textBox1? Hope you know what I mean.



Yes, i know what do you mean. I checked it, it is rendered with the actual ID for textbox1

Jim
#12 Posted : Friday, July 10, 2015 3:48:42 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Sorry, I missed the problem when I translated my test code to yours

Code:

rsw_getTBSFromTB(document.getElementById('<%=textBox1.ClientID%>')).focus();


that's what you need.
-your feedback is helpful to other users, thank you!


hamed
#13 Posted : Friday, July 10, 2015 11:58:16 AM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
Sorry, I missed the problem when I translated my test code to yours

Code:

rsw_getTBSFromTB(document.getElementById('<%=textBox1.ClientID%>')).focus();


that's what you need.

There is no exception but the problem is that i have to click the textbox every time when i want to send a message and even the the enter of keyboard doesn't work, i have to use the button on the user interface.

Jim
#14 Posted : Friday, July 10, 2015 5:18:39 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Let's come back to the 'enter' key issue - it's resolvable.

Regarding focus - it works for me in IE11, FF and Chrome. I didn't try any other browsers. Which are you using?

If it's not a browser specific issue, then I would need to see a mockup of the problem, as it is likely something specific about your page. If you don't want to do that then you can try something like this

Code:

setTimeout(function(){rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();}, 500);


using the setTimeout might workaround any competing focus issues happening on the page. But a better solution would be to send me a mockup so I can see what the trouble really is.
-your feedback is helpful to other users, thank you!


hamed
#15 Posted : Friday, July 10, 2015 5:50:45 PM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
Let's come back to the 'enter' key issue - it's resolvable.

Regarding focus - it works for me in IE11, FF and Chrome. I didn't try any other browsers. Which are you using?

If it's not a browser specific issue, then I would need to see a mockup of the problem, as it is likely something specific about your page. If you don't want to do that then you can try something like this

Code:

setTimeout(function(){rsw_getTBSFromTB('<%=textBox1.ClientID%>').focus();}, 500);


using the setTimeout might workaround any competing focus issues happening on the page. But a better solution would be to send me a mockup so I can see what the trouble really is.

It still didnt work and it threw an exception when i added the above line. I am also using IE11. I would like to send you a mockup but my project has very big files. Another issue, sending the text to chat screen is taking too long and it was very fast before adding the spell checker. Is it possible to disable the spell checking for chat screen and have it only for input textbox. Maybe this could be the reason
Thank you for replies
hamed
#16 Posted : Saturday, July 11, 2015 1:26:03 AM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Hi Jim,
It worked fine now for cursor focus but the enter still didnt work for the keyboard.each time i have to click the button.Last question,How to disable the spelling checker for any textbox for example, the chat screen box
Jim
#17 Posted : Saturday, July 11, 2015 7:29:34 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi Hamed, this will resolve the Enter issue, update to this script in your scripts folder

https://www.dropbox.com/...-AYT.js?dl=0&t=6576

You already found how to disable spell check in your other thread but for other readers, it's here
https://keyoti.com/produ...s/JSmode/As_you_type.htm
-your feedback is helpful to other users, thank you!


hamed
#18 Posted : Saturday, July 11, 2015 7:45:36 PM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
[quote=Jim]Hi Hamed, this will resolve the Enter issue, update to this script in your scripts folder

https://www.dropbox.com/...-AYT.js?dl=0&t=6576

You already found how to disable spell check in your other thread but for other readers, it's here
https://keyoti.com/produ.../JSmode/As_you_type.htm[/quote]
Thank you Jim, Enter key is working fine now but disabling spell, where i have to put the line?
i put it inside the javascript but it is still not disabled.
Jim
#19 Posted : Saturday, July 11, 2015 9:17:27 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Let's leave that Enter issue to the other thread... thanks
-your feedback is helpful to other users, thank you!


hamed
#20 Posted : Saturday, July 11, 2015 11:47:30 PM
Rank: Member

Groups: Registered

Joined: 7/9/2015
Posts: 20
Location: United Kingdom
Jim wrote:
Let's leave that Enter issue to the other thread... thanks

Thank you
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.