Disable Mac OS X Lion Safari autocorrect on contentEditable div?

We have a web application with lots of contentEditable <div>. With aggressive gas stations in Safari on Mac OS X Lion, we had a lot of problems with Safari trying to auto-correct for our users.

I was able to stop this by manually going to "Edit> Spelling and Grammar" and disabling the "Correct Spelling" option. I am wondering, however, if there is a way to do this programmatically, either in javascript or using the html attributes. From the Apple documentation ( http://developer.apple.com/library/IOs/#documentation/AppleApplications/Reference/SafariWebContent/DesigningForms/DesigningForms.html ) in the fields of the html form there is an autocorrect attribute that allows the site developer to decide whether to enable the site developer autocorrect.

Is this an autocorrect attribute only for mobile safaris? Does it work on contentEditable divs? If not, is there another alternative that just tells users to go and turn off auto-completion manually?

+5
source share
2 answers

You can use the attribute spellcheckto enable or disable spell checking (possible values trueand false)

More information about this attribute can be found in the HTML5 specification .

+2
source

Implementing the ability to disable automatic fix / autocomplete in iOS Safari is currently incomplete. For normal fields, inputan attribute autocorrectcan be used to disable automatic completion:

<input type="text" name="feild1" autocorrect="off">

But this attribute does nothing for typing divwith contenteditable, as well as for the tag. Both:

<div contenteditable="true" autocorrect="off"><p>Edit me!</p></div>

and

<div contenteditable="true"><p autocorrect="off">Edit me!</p></div>

. Apple autocorrect / .

, , contentEditable div. Apple, bugreport.apple.com? , , .

0

All Articles