disallow selection inside an input element

Posted by mkoryak on Stack Overflow See other posts from Stack Overflow or by mkoryak
Published on 2010-04-15T13:59:03Z Indexed on 2010/04/15 14:33 UTC
Read the original article Hit count: 323

Filed under:
|
|

I am looking to do the following

  • Disallow text selection inside of an input element
  • Do not show the cursor carrot inside of an input

i cannot simply blur the input on click, focus must remain in the input. There is probably a way to do this in just IE, i would of course rather have a cross browser solution but ill settle for IE (or FF) only solution.

Here is a demo page where you can see why i might need this functionality:

http://programmingdrunk.com/current-projects/dropdownReplacement/

if you click on the dropdowns in the first row on page, you will see the carrot inside the dropdown which looks funny. (this wont happen in chrome, but will in FF or IE)

© Stack Overflow or respective owner

Related posts about dom

Related posts about JavaScript