[英]Column of text type returned but not displayed in laravel 5.4 edit form
Working on an edit form, i'm able to display all data from my query except the one for addresses. 在编辑表单上工作,我能够显示查询中的所有数据,但地址除外。 Looked up my code and it looks good but still the old data from database isn't showing in that field. 查找了我的代码,看起来不错,但是数据库中的旧数据仍未显示在该字段中。 Could this be the way am calling it since its of text type? 因为它是文本类型,这可能是调用它的方式吗?
Controller 控制者
public function edit($id)
{
$customer= Customer::findOrFail($id);
dd($customer->contact_address);
//return view('customers.edit', compact('customer'));
}
dd($customer->contact_address) returns dd($ customer-> contact_address)返回
"18B Harvey Street, Crosstour Estate. Ikeja, Lagos."
edit form field 编辑表格栏位
<div class="form-group">
<label for="contact_address" class="col-md-4 control-label">Contact Address</label>
<div class="col-md-6">
<textarea id="contact_address" type="text" class="form-control" name="contact_address" value="{{ $customer->contact_address }}" row="3" required autofocus></textarea>
</div>
</div>
How do make it display like the other field are? 如何使其像其他字段一样显示?
value
is not a textarea attribute, output the address between the textarea tags: value
不是textarea属性,输出textarea标签之间的地址:
<textarea>{{ $customer->contact_address }}</textarea>
Alternatively, I believe textarea
elements support the placeholder
attribute, so: 另外,我认为textarea
元素支持placeholder
属性,因此:
<textarea placeholder="{{ $customer->contact_address }}"></textarea>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.