Home » Html » HTML – How can i disable auto text correction in my TEXTAREA?

HTML – How can i disable auto text correction in my TEXTAREA?

Posted by: admin November 29, 2017 Leave a comment

Questions:

My textarea contains C# code, so i get red underlines all over the place, is there any way to disable auto correction on a TEXTAREA in html code?

Thank

Answers:

I believe you may be looking for <textarea spellcheck="false"></textarea>

Source: https://developer.mozilla.org/en/controlling_spell_checking_in_html_forms

Questions:
Answers:

There are two more attributes other than spellcheck="false" for iOS (probably Android too) that you might need to add to your text inputs to avoid OS interferer with text content:

  • autocorrect="off" for avoiding to complete or suggest a word
  • autocapitalize="off" for avoiding OS transforming book to Book
  • spellcheck="false" for avoiding OS from highlighting spell errors

enter image description here

Questions:
Answers:

Try adding the following code to your textarea:

 spellcheck="false"

Note that this will make your code invalid so you might want to inject it with javascript or something after the DOM has loaded if it’s important to you.