Kyle
Kyle

Reputation: 607

Disabling iPhone keyboard for textarea in web application

So I have multiple textareas on my page that are editable depending on a users status. The problem is that even when a user clicks on a textarea that they are not allowed to edit, the keyboard comes up on mobile safari. The user can't actually edit the textarea, but it's really annoying/looks bad. I was thinking of maybe making it disabled but without actually changing it's look. Any suggestions?

Upvotes: 2

Views: 1478

Answers (2)

Dev01
Dev01

Reputation: 14179

Have you tried disabling the input/textarea field? I think if you click on that the keyboard says closed.

<index disabled />

or

<textarea disabled />

Upvotes: 0

Nevin
Nevin

Reputation: 7819

Are you using TextView or TextField? For a TextView you can set Editable to NO to prevent the keyboard being popped up.

For TextField I guess you can set userInteractionEnabled to NO. Haven't tried this before though.

Upvotes: 1

Related Questions