【发布时间】:2021-11-05 21:50:41
【问题描述】:
我需要在 laravel Blade 中设置两个相同输入的旧值。 第一个 div 工作正常,但第二个不工作。
注意:更新方法的请求是
'parent_id' => $request->council_parent_id,
'parent_id' => $request->parent_id,
this one render the old value but this one is empty
<div class="form-group parent_id">
{{ Form::label('parent_id', 'اختر اللجنة الرئيسية', ['class' => 'control-label']) }}
{{ Form::select('parent_id', $parents, \Input::old('parent_id') , ['placeholder' => '','class' => 'form-control parent_id select2d']) }}
<span class="text-danger">{{ $errors->first('parent_id') }}</span>
<div class="form-group council_parent_id">
{{ Form::label('council_parent_id', 'اختر المجلس الرئيسي', ['class' => 'control-label']) }}
{{ Form::select('council_parent_id', $council_parents,\Input::old('parent_id') , ['placeholder' => '','class' => 'form-control council_parent_id select2', 'value' => $mainCouncil]) }}
<span class="text-danger">{{ $errors->first('parent_id') }}</span>
【问题讨论】:
-
在你的第二个中你有
value => ...并尝试通过\Input::old设置值 -
你的意思是删除值?
-
是的,尝试这样做,并在第三个参数中尝试
\Input::old('parent_id', $mainCouncil) -
感谢您的回复,但仍然无法正常工作,兄弟
-
还是没有出现
标签: php html laravel laravel-blade