views:

55

answers:

1

Hi All

I have a requirement that a user is allowed only to enter string value in a text field. I need to ensure that he is not allowed to change the keyboard layout, once the keyboard is presented to him on clicking of the field. Is there a way to disable the button for changing the keyboard layout?

Thanks in advance

A: 

This question describes a similar problem - accepting only a numeric value. Adapting this to accept only some subset of characters means that even if the user changes the keyboard, she won't be able to enter invalid input.

Even if you force the user to use a particular keyboard, you should still control the input with the UITextViewDelegate protocol as described in the referenced answer.

Frank Shearar
Thanks for the answer Frank. It works for the case where only numeric value is allowed. I was searching for a solution for a general case. I saw this functionality in an app, which disables the changing of keyboard layout in text fields, to restrict the input to be of a particular type only.
Vin