How to Disable the Spell Checker on Text Inputs on the Iphone

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

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.

How to disable spell check for a contenteditable div in a UIWebView?

Please Check this. How can I disable the spell checker on text inputs on the iPhone

Disable auto correction of UITextField

UITextField* f = [[UITextField alloc] init];
f.autocorrectionType = UITextAutocorrectionTypeNo;

Disable predictive text on iPhone for a form field

From the user side you can

Settings > General > Keyboard >
Auto-Correction On/Off.

from the app side, i don't think it can be done.

Disable spell-checking on HTML textfields

Update: As suggested by a commenter (additional credit to How can I disable the spell checker on text inputs on the iPhone), use this to handle all desktop and mobile browsers.

<tag autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>

Original answer: Javascript cannot override user settings, so unless you use another mechanism other than textfields, this is not (or shouldn't be) possible.

Disable autocorrect in Safari text input

You need to add spellcheck="false" to your input.

<input autocomplete="off" autocorrect="off" autocapitalize="off" type="text" name="url" placeholder="Enter a web address" spellcheck="false">

How to programmatically turn off Auto Correction in iphone sdk?

You can use the following property:

myTextField.autocorrectionType = UITextAutocorrectionTypeNo; //in ios 8 use UITextAutocorrectionTypeNo.

As defined in the UITextInputTraits protocol here

iOS: Highlight spelling errors but disable suggestions?

You will have to roll your own. Here's a rough (iOS 5 and later):

Drop a view with transparent background on top of the text view.

Find the visible range of text like so:

- (NSRange)visibleRangeOfTextView:(UITextView *)textView {
CGRect bounds = textView.bounds;
UITextPosition *start = [textView characterRangeAtPoint:bounds.origin].start;
UITextPosition *end = [textView characterRangeAtPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMaxY(bounds))].end;
return NSMakeRange([textView offsetFromPosition:textView.beginningOfDocument toPosition:start],
[textView offsetFromPosition:start toPosition:end]);
}

Search for misspelled words in that range.

Find their on-screen coordinates using UITextView firstRectForRange method.

Highlight any way you want.

Deciding when to do this is left as an exercise for the eager student :)



Related Topics



Leave a reply



Submit