SpellCheckAsYouType disables textarea oninput event

41 views
Skip to first unread message

KC

unread,
Jan 23, 2017, 10:35:56 AM1/23/17
to JavaScriptSpellCheck, Kasia Cameron
When I have SpellCheckAsYouType my oninput event is no longer firing - see example below.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>JavaScriptSpellCheck - Hello World</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type='text/javascript' src='include.js' ></script>
</head>
<body>
<textarea name="myTextArea" id="myTextArea" cols="50" rows="20">Hello Worlb. This Example show JavaScript Spellcheck "as-you-Type" and also spellchecking window functionality on the same page. Implementation is easy using only a few lines of Java Script - and will work on alost all modern web hosting packages - both Linux and Windows based. </textarea>
<input type="button" value="Spell Check" onclick="$Spelling.SpellCheckInWindow('myTextArea')">
<br/><br/><br/><a href="http://www.javascriptspellcheck.com/Demos_And_Tutorials">More Examples and Documentation...</a>
<script type='text/javascript'>
$('#myTextArea').on("input", function ()
{
alert('input');
});

$Spelling.SpellCheckAsYouType('myTextArea');
</script>
</body>
</html>

Live Spell

unread,
Feb 2, 2017, 2:56:49 AM2/2/17
to KC, JavaScriptSpellCheck, Kasia Cameron
Hi Kasia,

This is likey to do with even binding timing.

option 1


        <textarea name="myTextArea"  id="myTextArea" cols="50" rows="20" onkeyup="alert(1)">

option 2

 $Spelling.SpellCheckAsYouType('myTextArea');
$('#myTextArea___livespell_proxy').on("input", function ()
        {
            alert('input');
});

   

       


--
You received this message because you are subscribed to the Google Groups "JavaScriptSpellCheck" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascriptspellc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

iainan...@gmail.com

unread,
Feb 2, 2017, 5:00:06 AM2/2/17
to JavaScriptSpellCheck, iainan...@gmail.com, Kas...@inisoft.co.uk
Unfortunately onkeyup will not work for me as my javascript depends on the content of the textarea and this is not set at the time of the keyup event (when spellcheck as you type is turned on).

<textarea name="myTextArea" id="myTextArea" cols="50" rows="20" onkeyup="alert($('#myTextArea').val());">

The text displayed here is always one character behind.

I have tried option 2 but the event is still not fired.

Cameron, Kasia

unread,
Feb 9, 2017, 5:17:47 AM2/9/17
to JavaScriptSpellCheck
Hi. Is there any update on this? We are keen to purchase a licence but this issue is holding us up.

Thanks
Kasia.



Kasia Cameron
Senior Web Developer
Inisoft Limited

Phone: +44 (0)141 552 8800
Email: kas...@inisoft.co.uk | Web: www.inisoft.co.uk

Citypoint, 21 Tyndrum Street, Glasgow, G4 0JY.



A Kura Company
This message is sent in confidence for the addressee only. It may contain legally privileged information.
Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission.
No liability is accepted by Inisoft Limited for any losses caused by viruses contracted during transit over the Internet or present in any receiving systems.
This e-mail is not intended to create legally binding commitments on behalf of Inisoft Limited nor do its contents reflect the corporate views or policies of Inisoft Limited.

Inisoft Limited, Citypoint, 21 Tyndrum Street, Glasgow, G4 0JY. Registered in Scotland No. SC 290311

P Please consider the environment before printing this email.

Live Spell

unread,
Feb 14, 2017, 4:34:02 AM2/14/17
to Cameron, Kasia, JavaScriptSpellCheck
Hi Kasia

If you can post a url we can look at .. or simple working project we can download it will really help narrow it down.

T Zainab Kemsley - Production Team Leader

iainan...@gmail.com

unread,
Feb 14, 2017, 4:35:53 AM2/14/17
to JavaScriptSpellCheck, Kas...@inisoft.co.uk
There is an example in my original post:

Live Spell

unread,
Feb 14, 2017, 4:44:39 AM2/14/17
to iainan...@gmail.com, JavaScriptSpellCheck, Kas...@inisoft.co.uk
My bad.

Live Spell

unread,
Feb 14, 2017, 4:59:12 AM2/14/17
to iainan...@gmail.com, JavaScriptSpellCheck, Kas...@inisoft.co.uk
Ok 'input' is not a real DOM event so we can not bind to it. 
But we can do this:

       <script type='text/javascript'>
        $Spelling.SpellCheckAsYouType('myTextArea');
        $('#myTextArea').on("keyup", function ()
        {
            setTimeout(function(){ alert($('#myTextArea').val())},1);
        });
    </script>

Not pretty - but it works perfectly.


Reply all
Reply to author
Forward
0 new messages