tags:

views:

54

answers:

3

Sometime certain words typed into an input type text box, is shown with a red underline on the browser indicating that the word could be grammatically incorrect.

How do I prevent this from showing up?

+1  A: 

Spellcheckers in browsers are a nonstandard feature. Some come with the OS, some are browser specific plugins. I doubt there's a common way to turn them off, if there's one at all.

The bigger problem is that the attitude of controlling every last bit of the experience doesn't work very well on the web. There are a virtually infinite number of ways how a website can be consumed. You simply can't control every last aspect of it. Spellchecking is one of the things users enable for themselves because they like it. They are used to getting red lines here and there. Maybe they have added those words to their dictionary. Maybe the red line in itself is a useful check for them. You have no business meddling with this choice.

You control your page up to the HTML, CSS and Javascript you serve. However the user chooses to further enhance the site using plugins, features or specific browsers is not up to you.

deceze
In browsers where I've seen spellchecking, it's been on by default. In general I find it annoying to see red underlines in text fields that aren't supposed to be English text, and would actually like HTML authors to designate which fields shouldn't be spellchecked.
Gabe
@Gabe Then this topic is apparently more controversial than I thought. I'm firmly of the opinion to let the user decide this.
deceze
deceze: Do you also let the user decide what text should be bold? After all, if the user has chosen that all text shouldn't be bold, it would be surprising for them to see bold words where they don't expect them, right? :)
Gabe
@Gabe Now you're just twisting my words, or I don't get what you're playing at. :o)
deceze
I just don't understand why it's perfectly valid to want to change the background color or font on part of a page, yet spellchecking is somehow a sacred setting that cannot be touched.
Gabe
@Gabe Because it's *your* page, but it's *my* spellchecker. If *you* put the spellchecker there via Javascript or some such, it's under your control, just like the rest of the page. The spellchecker is provided by the OS or the browser though. You didn't activate it, so you shouldn't deactivate it either.
deceze
deceze: All I'm doing is indicating in markup which form elements are not intended to be text. Your browser is free to ignore my markup to whatever extent it feels, just as it is free to ignore my request for bold fonts or blue backgrounds. If your browser does not have a setting that allows it to ignore said markup, you should change your browser.
Gabe
@Gabe You can prevent the address bar from showing the correct URL by using frames, you can disable right-click or control the window size of the browser using Javascript, you can restyle the scroll bar using CSS (in some browsers). There are many things you *can* do, but that doesn't mean you should. :)
deceze
A: 

You can't! You have to live with it :D

SiN
A: 

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.