Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stephan-v's avatar

Laravel old input messing with bootstrap textarea

I am using bootstrap and noticed that when I drop my old('description) in my textarea tag that whenever you focus click on the textarea you can click anywhere.

Normally it starts the cursor top left on focus but the old() function messes it up. This leads to a lot of white space being inserted in my tables. Did anyone else notice this? Hopefully somebody knows how to fix this.

It's pretty weird because when I look at the html there is nothing there.

<textarea name="description" id="description" class="form-control" rows="5">
    // old('description') (removed the blade tags since it wouldn't show otherwise)
</textarea>
0 likes
6 replies
rockhopper72's avatar
Level 9

I believe it is because the way the code is indented the html thinks that it is part of the content, similar to if you put it in pre tags. You should be able to fix it by doing something like this:

<textarea name="description" id="description" class="form-control" rows="5">old('description')</textarea>

(making it all one line)

With the blade tags, of course

3 likes
rockhopper72's avatar

Make sure to add the blade tags around old('remarks') so it becomes {{ old('remarks') }}

Buenosbenos's avatar

I know i´m late ;) ... {!! old('description ') !!} did the trick for me. (first week of laravel and 2. month programming )

Please or to participate in this conversation.