How TO – Disable Spellcheck for Forms
Learn how to turn off spell checking (grammar correction) for form elements.
Turn Off Spellcheck
By default, when you enter text inside a form element, you will see a red underline below words that are not spelled right/incorrect. However, you can use spellcheck="false" to turn off spell checking:
Example
<!DOCTYPE html>
<html>
<body>
<h2>Disable Spellcheck</h2>
<form action=”/action_page.php”>
<p>Your Name:</p>
<input type=”text” name=”fname” spellcheck=”false”>
<p>Your Story:</p>
<textarea name=”story” spellcheck=”false”></textarea><br>
<input type=”submit”>
</form>
<p>Try to type words that are incorrect inside the input and the textarea. Remove the spellcheck attribute and try again to see the difference.</p>
</body>
</html>
You can also turn of spell checking for the whole form:
Example
<!DOCTYPE html>
<html>
<body>
<h2>Disable Spellcheck</h2>
<form action=”/action_page.php” spellcheck=”false”>
<p>Your Name:</p>
<input type=”text” name=”fname”>
<p>Your Story:</p>
<textarea name=”story”></textarea><br>
<input type=”submit”>
</form>
<p>Try to type words that are incorrect inside the input and the textarea. Remove the spellcheck attribute and try again to see the difference.</p>
</body>
</html>