Reputation: 670
I'm trying to create a hidden textfield for an iphone specific site, basically I've taken a textfield, hidden all of its elements and show an image instead, when clicked this pops up an onscreen keyboard, as well as submitting when the form loses focus.
What I can't get rid of is the text caret. It flashes at me as if I'm some loser who can't set his VCR to anything but 12:00.
Upvotes: 1
Views: 1184
Reputation: 17084
Why not just change the type of the input element to "hidden" when it's not supposed to be edited? E.g.
<input type="hidden" name="datafield" id="datafield" />
That way it won't allow for the caret to be standing on it. If you need its value to be displayed, add a DIV
and populate it with the datafield value. Then just put a click event on the DIV
to activate the input field.
Upvotes: 0
Reputation: 61727
Have you tried disabling the text field as well? disabled="disabled"
Upvotes: 2