Is it possible for a disabled <input> tag to support text selection?
5 Answers
You could use the ReadOnly attribute.
5 Comments
disabled attribute - the value in the field will be submitted to the receiving scriptreadonly attributeBased 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.)
Comments
This will depend heavily on the browser. It works fine for me in Chrome and IE8: JSFiddle
Firefox (3.6) seems to be the one browser that doesn't support it. I don't think you can do anything about that.
Comments
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"...