Turn Off Chrome/Safari Spell Checking by HTML/Css

Turn off Chrome/Safari spell checking by HTML/css

Yes, there is the HTML5 spellcheck attribute.

<textarea spellcheck="false"> or <input type="text" spellcheck="false">

http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#spelling-and-grammar-checking

Update: This is now supported in the latest versions of all browsers.

Is there a way to turn off spell check in a textarea?

got it figured out

function bindEditorFocus() {
var $editor = $('#editor');
$editor.focusin(function(){
$(this).attr('spellcheck', true);
toggleSpellingcheck(); // loop through all words to add marker
});

$editorblur(function(){
$editor.attr('spellcheck', false);
$editor.unbind(); // I need to unbind all function to avoid a loop
toogleSpellingcheck(); // loop through all words to remove marker
$editor.blur(); //get out of text area
bindEditorFocus(); // rebind all functions
});
}


function toogleSpellingcheck(){
//this will loop through all words
var $editor = $('#editor');
var text = $editor.val();
for (var i = 0; i < text.length; i++) {
$editor.caret({start:i,end:i});
}
}

the toogleSpellingcheck method loop through all words, it can be optimized to loop through words instead of characters, but this would need the jquery caret plugin

it's a bit messy, but works, anyone got suggestions on improvements please let me know

How does one disable spellcheck on input type=text?

From http://blog.whatwg.org/the-road-to-html-5-spellchecking#compatibility:

Google Chrome offers as-you-type spellcheck on <textarea> elements but not <input type=text> elements. It ignores the spellcheck attribute entirely. It does not offer the end user the option to change the default behavior or manually check individual fields.

So, it ends here.


Update: since Chrome 13 (released August 2011, 3 months after this answer), it's also supported on <input> elements.

Disable spell-checking on HTML textfields

Update: As suggested by a commenter (additional credit to How can I disable the spell checker on text inputs on the iPhone), use this to handle all desktop and mobile browsers.

<tag autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>

Original answer: Javascript cannot override user settings, so unless you use another mechanism other than textfields, this is not (or shouldn't be) possible.

Corrective underline in CSS input?

I think the attribute spellcheck for HTML elements might be what you are looking for:

<textarea spellcheck="false"></textarea>

Should work on every element type, especially inputs. Documentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck

CKEditor 3.6.3 Enable browser spellcheck and disable context menu

There's a config setting that disables the built-in spell checker if a browser provides one. It's set to true by default, try setting it to false.

config.disableNativeSpellChecker = false;

You can try disabling the contextmenu plugin:

config.removePlugins = 'contextmenu';

How to disable grammatical correctness check on input type text fields

I added the spellcheck attribute to the input type text field and it disabled spell checks just for that field. The above fix works, thanks for all who responded.



Related Topics



Leave a reply



Submit