2

Is it possible to detect if input text value/string width is bigger than input itself. I want to apply some addtional styles if all the text in input is not visible.

The font size can be dynamic so I can't convert each char to pixels.

Appreciate any feedback. This needs to work only in IE.

JS-JMS-WEB
  • 2,555
  • 3
  • 17
  • 26
  • 1
    Does this help: http://stackoverflow.com/questions/4834445/detect-if-text-in-an-input-type-text-element-exceeds-bounds-in-firefox ? – Rahul Tripathi Nov 10 '15 at 13:18
  • 2
    You could mesure the size of your string (http://stackoverflow.com/a/21015393/4734683) and compare it to your input size, minus your left and right padding of course ! – Remy Grandin Nov 10 '15 at 13:18
  • 1
    There is workaround: http://stackoverflow.com/questions/10209831/detect-if-text-overflowellipsis-is-active-on-input-field – Jasiu Nov 10 '15 at 13:19

0 Answers0