How can I disable the spell checker on text inputs on the iPhone

笑着哭i 提交于 2019-11-26 10:32:23

问题


Sometimes the spell checker is unnecessary, captchas, usernames, emails, etc. Is there a way disable it on some text inputs/text areas?


回答1:


As noted by my buddy Jonathan Stark, you should be able to use attributes like autocorrect and autocomplete to achieve the effect you're looking for:

<input type="text" placeholder="My Field" name="myfield"
    autocapitalize="none" autocorrect="off" autocomplete="off" />

Just tested in OS4 and it's working.

UPDATE: As of iOS5 on and off values in autocapitalize have been deprecated. Use none to completely disable automatic capitalization.




回答2:


Actually there is literally a spell check attribute in HTML5:

<textarea spellcheck="false">

Re: http://blog.whatwg.org/the-road-to-html-5-spellchecking

Browser support is, of course, limited.



来源:https://stackoverflow.com/questions/3416867/how-can-i-disable-the-spell-checker-on-text-inputs-on-the-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!