HTML input wrap text instead of overflow horizontally

Viewed 62776

I have an input field, in which a user will enter text inside. When the text becomes too long, the input field extends horizontally instead of dropping down vertically.

I tried adding this CSS:

overflow: hidden;
word-wrap: break-word;

but I had no luck. Any other suggestions on how to accomplish this?

3 Answers

This is a soultion i found, Just use a hidden input and use a button for the text with a action for the form.

<form method="post" action="nextpage.php">

    <input style="display: none;" name="name" type="text" value=“somedata"></input>

    <button>Some text that you want to wrap but also submit the form </button>

</form>
Related