20

I'd like to disable the spellcheck on my textfields <input type="text"> so as not to have any ugly red squigglies.

I understand others have asked this same question, but they always make the answer of putting spellcheck=false as accepted. That is not correct. That only works on a textarea, not input.

I'd like it to work in chrome at least.

tybro0103
  • 48,327
  • 33
  • 144
  • 170

6 Answers6

17

Updated Jan 2020

spellcheck=false and spellcheck="false" now both work in Chrome.

Original answer:

While spellcheck=false doesn't work in Chrome as mentioned in the question, spellcheck="false" works successfully.

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
chuck911
  • 745
  • 9
  • 11
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – James Donnelly Oct 16 '13 at 08:21
  • 1
    @JamesDonnelly the answer is short - spellcheck="false" . but I can't post too short answer. this is not "critique or request clarification from an author",this is answer – chuck911 Oct 16 '13 at 09:20
  • This answer isn't correct and is more of a comment than an answer. You don't need to wrap HTML attributes in quotes, and the spellcheck property is designed specifically for `textarea` elements. – James Donnelly Oct 16 '13 at 09:22
  • 1
    @JamesDonnelly try it in your chrome yourself ! – chuck911 Oct 16 '13 at 09:23
  • the `spellcheck` attribute doesn't affect `input` elements in Chrome. Setting it to `true` or `false` will not achieve anything. – James Donnelly Oct 16 '13 at 09:29
  • 2
    @JamesDonnelly May be surprising, but it does work now (I'm on Chrome 31.0.1650.34). http://jsfiddle.net/vr9pR/ - Type in some misspelled words in the two boxes. – Alfred Xing Oct 29 '13 at 05:58
  • Works for me too. I'm happy with your answer @chuck911. – Marino van der Heijden Nov 21 '13 at 08:55
  • Note that the question explicitly says that it **works** on textarea fields, not on input fields. So it's very reasonable to assume that the OP just quickly entered the unquoted attribute value off top of head for the sake of asking a question rather than actually having used an unquoted attribute value as such. – BalusC Apr 13 '15 at 12:36
15

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I would not worry about this. It's enduser's own choice to spellcheck input fields. You should not force the browser to behave different on your site. I have immediately disabled spellchecking myself anyway. – BalusC May 13 '11 at 03:03
  • 1
    @BalusC That is just stupid, there are enough reasons to disable accessibility options. For example if you do the spelling check yourself, same goes with the focus glow around buttons which you might want to handle yourself. Or maybe a practice application in JavaScript in which you want to see how well somebody can spell stuff as a matter of a test and there are many more reasons. Thus you should be able to force it, and luckily it is possible. – Yeti Nov 26 '12 at 15:01
  • This answer is deprecated. – Sebas Dec 05 '13 at 01:12
  • @Sebas: I believe you meant to say "outdated" :) – BalusC Dec 05 '13 at 01:20
1

You can use either spellcheck=false or spellcheck="false" in an <input type="text">. This is a slight update to other answers posted.

jsfiddle.net/8nc2w6e0

Tested on Chrome 39.0.2171.95.

HydraHatRack
  • 1,260
  • 2
  • 16
  • 20
0

I'm sure BalusC's answer was accurate at the time, but I think it's out of date. I'm testing this right now in Chrome 31.0.1650.57 on Win7, and spellcheck="false" definitely suppresses the dreaded red squigglies in an <input type="text">.

In general I agree that you shouldn't do this, but there are exceptions to any rule. (In my case, the input is expecting base64.)

mrec
  • 760
  • 1
  • 8
  • 16
0
<table spellcheck="false"> ....
     <td><textarea> blabla </textarea></td> ....
     ....... <td><textarea> xxxxx </textarea></td>
</table>

works for FF CH

bortunac
  • 4,642
  • 1
  • 32
  • 21
0

Also note, that when referencing from React/jsx the property name should be with capital C letter spellCheck="false"

Kurovsky
  • 1,081
  • 10
  • 25