Auto-width / text field / pre-pop...
- Last post
- 4 Responses
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...
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.
you can find something here
width: 100%, then set the container widths maybe.
Have you tried pre-filling the input field with the attribute "value", not "placeholder" with your said scripts?