rwx rwx - 10 months ago 36
CSS Question

Add additonal row to input if text is too long


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).



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