Auto-width / text field / pre-pop...
- Started
- Last post
- 4 Responses
- slinky
Anyone have an idea how to get a text field width to automatically size to dynamic pre-populated values?
I have found a few jquery scripts that will auto-size the field as someone is typing in the field, but none that will resize according to dynamic pre-populated content...
thanks!
- monNom0
You can stick the text into a span, use JS to grab the width of the span once it's rendered, then set your text field to match the width of the span. If you keep the fonts consistent you should end up with a pretty close result. maybe add a small fudge factor to prevent any issues with overflowing text.
- zaq0
you can find something here
http://www.unheap.com/?s=text+fi…
- instrmntl0
width: 100%, then set the container widths maybe.
- mekk0
Have you tried pre-filling the input field with the attribute "value", not "placeholder" with your said scripts?