0

Question

How can i linebreak the input and add an additional "row" if the value text is too long for the current input width (bootstrap responsiveness).

Current code

<input id="someID" type="text" class="form-control" value="some text that is too long for my input width">

The value is prefilled by a passed django variable (but that doesn't matter).

Example

http://www.bootply.com/Y1IFdLMpig

rwx
  • 696
  • 8
  • 25

1 Answers1

1

Are you looking for a new input field? If that is the case you count the characters passed and add another input field if character count > whatever you define. If you are looking to make the input field multi-line - my understanding is that you need to use a textarea instead.

<textarea>This is where you put the text.</textarea>

You can also look at the following if you want it to be auto-resized: Creating a textarea with auto-resize

Community
  • 1
  • 1
  • 1
    If someone is interested i do now use a `textarea` with `rows=1` and then change the height by `$("textarea").height( $("textarea")[0].scrollHeight );` – rwx Jun 10 '16 at 19:33