Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 spellcheck - any way to determine if a any misspelled words have been found

I'd like to use the HTML5 spellcheck attribute to check for input typos. Using angularJS so would display an alert if the user tries to submit with typos. Is there any way to access some state that says if typos have been found in a text block.

like image 627
HandyManDan Avatar asked Mar 29 '14 01:03

HandyManDan


People also ask

Does spell check find all errors?

The wrong word Spell check does just that: catches words that are spelled wrong. But if you write the wrong word altogether, spell check won't save you if that word is spelled correctly.

How do you use spell check in HTML?

HTML spellcheck AttributeThe spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not. The following can be spellchecked: Text values in input elements (not password) Text in <textarea> elements.


1 Answers

You can use this javaScript plugin: https://www.javascriptspellcheck.com/

To use it you just need to unzip it and reference it. It also has a "Hello World" tutorial and well documented methods at their site.

The provided working example codes like this:

<script type='text/javascript' src='/JavaScriptSpellCheck/include.js' ></script>
<script type='text/javascript'>$Spelling.SpellCheckAsYouType('myTextArea')</script>
<textarea name="myTextArea"  id="myTextArea" cols="30" rows="4" style = 'max-width:500px;width:100%;height:200px;margin-bottom:20px'>
        This this is a simple exampl of Spell-checking As-You-Type using javascript spellcheck.
        It works in almost any browser, and supports upto 24 international languages.
        The button bellow shows an alternative way to spellcheck using javascript spellcheck - using a dialog iwndow!
</textarea>
<input type="button" value="Spell Check in a Dialog" onclick="$Spelling.SpellCheckInWindow('myTextArea')" />
like image 58
María Antignolo Avatar answered Sep 29 '22 18:09

María Antignolo