Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I avoid iphone safari first letter in caps

I am designing a small webpage targeted for the iPhone/iPod touch. I have a form that requires the user to enter a code. When you tap on the corresponding field, the iphone will automatically set the first letter to caps. Is there any way to avoid this? I want the whole field to be entered in small caps.

Thanks

like image 551
DanC Avatar asked Oct 16 '09 22:10

DanC


People also ask

How do I make my iPhone not capitalize the first letter?

Open the Settings app. Tap the section called "General." Tap "Keyboard." Tap "Auto-Capitalization" to toggle it off.

How do I get my iPhone to stop capitalizing certain words?

If you're on an iPhone, it's Settings | General | Keyboard | Auto-Capitalization “Off” by touching the green button. If there are just a few words that bother you, you can go Settings | General | Keyboard | Text Replacement, tap the plus sign, and put the word in lower case in both fields.

How do you not capitalize the first letter?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.


1 Answers

Edit: use "none" instead of "off". On your webpage, all you need to do is set the autocapitalize property to off for your input field. So:

<input autocapitalize="none">

See the Safari Web Content Guide: Designing Forms and Safari HTML Reference

Below is the answer I had before, which relates to native apps. Keeping around for anyone who's looking for that answer.

From the UITextField Documentation

The appearance of the keyboard itself can be customized using the properties provided by the UITextInputTraits protocol. Text field objects implement this protocol and support the properties it defines. You can use these properties to specify the type of keyboard (ASCII, Numbers, URL, Email, and others) to display. You can also configure the basic text entry behavior of the keyboard, such as whether it supports automatic capitalization and correction of the text.

So basically, the UITextField supports this protocol. The property needed is the autocapitalizationType. An example in code is:

myUITextField.autocapitalizationType = UITextAutocapitalizationTypeNone;

or if you dislike the dot notation:

[myUITextField setAutocapitilizationType:UITextAutocapitalizationTypeNone];
like image 124
bobDevil Avatar answered Sep 21 '22 17:09

bobDevil