laravel 如何从laravel的文本框中获取旧值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45487102/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 16:27:03 来源:igfitidea点击:
how to get old value from the textbox in laravel
提问by Nihal Saxena
<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.
在上面的代码中,在创建帖子时,如果有一些验证错误,帖子将使用用户提交的旧数据重新加载,但我得到的是空白文本区域。
回答by Bas
Put it in between:
把它放在中间:
<textarea class="form-control" rows="12" id="body" name="body" >{{Request::old('body')}} </textarea>
回答by AddWeb Solution Pvt Ltd
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 !!!
希望这对你有用!!!