Reputation: 122392
Is it possible for a disabled <input>
tag to support text selection?
Upvotes: 29
Views: 18110
Reputation: 30818
Based on the HTML spec, it looks like no:
- Disabled controls do not receive focus.
- Disabled controls are skipped in tabbing navigation.
- Disabled controls cannot be successful.
Are you able to use the readonly
attribute instead?
(Wow, "4 new answers have been posted"... I think the spec link is helpful, at least.)
Upvotes: 20
Reputation: 25554
readonly="readonly" is your answer
you can remove border in CSS or directly in styles, when you "blocked" this field and it will look like regular text, bring back the look when "unblocked"...
Upvotes: 2
Reputation: 146330
You may want to use a readonly
input and style it with CSS.
Upvotes: 3