1

I use a PHP variables as the value for the text input field, however the size of the value does not effect the size of the text field so the user has to scroll. As the PHP variable is data from an SQL tables, the value is not always the same and I therefore can not user HTML text area. The code is:

<input type="text" name="aboutme" value="<?php echo htmlspecialchars($aboutme); ?>" > 

How can I make it so the text field gets bigger as the value gets bigger, resulting in there being no scrollbar.

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
dominicansell
  • 85
  • 2
  • 10

1 Answers1

0

its usually a bad idea to use variable sizes on input, because they destroy your layout. back to your problem, set the size of your input to the length of your string with strlen

<input [...] size="<?= strlen($aboutme) ?>" /> 
fruuf
  • 81
  • 1