kiaaanabal kiaaanabal - 9 months ago 65
HTML Question

Wrap text within in a text input

I am needing to wrap text within a text input. I know that textareas have this functionality by default, but I need to use a text input to allow for submit on enter. Pressing enter in a textarea just brings you to a new line.

I've tried word-wrap and word-break, but those don't work. I'm assuming this is impossible, but I don't want it to be haha :)

Any help is appreciated!


Since you cannot wrap an input your best option would be to disable the enter in a text area, see fiddle:

<textarea id="something"></textarea>
if (e.keyCode == 13 && !e.shiftKey)
  return false;