Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get old value from the textbox in laravel

Tags:

laravel

<textarea class="form-control" rows="12" id="body" name="body" {{Request::old('body')}}>
</textarea>

In the above code while creating a post and if there are some validation errors the post will reload with the old data submitted by the user but i am getting the blank textarea.

like image 552
Nihal Saxena Avatar asked Aug 03 '17 14:08

Nihal Saxena


2 Answers

Put it in between:

<textarea class="form-control" rows="12" id="body" name="body" >{{Request::old('body')}} </textarea>
like image 101
Bas Avatar answered Oct 13 '22 12:10

Bas


I think you can try this :

{!! Form::textarea('body',old("description"),['class' => 'form-control','placeholder' => 'body']) !!}

OR

<textarea class="form-control" rows="12" id="body" name="body" >{{Input::old('body')}} </textarea>

Hope this work for you !!!

like image 41
AddWeb Solution Pvt Ltd Avatar answered Oct 13 '22 13:10

AddWeb Solution Pvt Ltd