我制作了一个表单,其中输入表将通过 ajax 加载,具体取决于 create.blade.php 中“machine”下拉列表的选定值。每当我提交表单并使用 dd($request) 时,它只返回以下内容:array:5 [▼ "_token" => "KRCNWU8jxnT2RSrCrNOuGX9tfdC0TVUWxO3gKVCP" "machine" => "14" "breakdowndate" => null "breakdowntime" => null "Add" => "Submit"]创建.blade.php <div id="add" class="modal fade" role="dialog"> <div class="modal-dialog modal-xl adjust-modal-xl"> <!-- Modal content--> <div class="modal-content"> <!-- <div class="modal-header text-center"> </div> --> <div class="modal-body"> <form class="form-horizontal" action="{{url('breakdown/store')}}" method="POST" id="add-form"> {{csrf_field()}} @if (count($errors->store) > 0) <div class="alert alert-danger"> <ul> @foreach ($errors->store->all() as $error) <li class="small">{{ $error }}</li> @endforeach </ul> </div> @endif <div class="form-group row"> <label class="label-control col-lg-2">Machine:</label> <div class="col-lg-4"> <select name="machine" id="machine" class="form-control chosen-select"> <option value=""></option> @forelse($machines as $machine) <option value="{{$machine->id}}">({{$machine->section}}) {{$machine->machine_no}}</option> @empty @endforelse </select> </div> </div>
1 回答
三国纷争
TA贡献1804条经验 获得超7个赞
好吧,很明显,我在 index.blade.php 中的 html 缺少</table>结束标签。现在它可以工作了,我现在明白了:
array:16 [▼
"_token" => "6Dej3itbusd4AjzN879BWDrT243cDz4P7FQRQvH5"
"machine" => "13"
"part" => array:5 [▶]
"disassembly" => array:5 [▶]
"measuring" => array:5 [▶]
"inspection" => array:5 [▶]
"correction" => array:5 [▶]
"assembly" => array:5 [▶]
"total" => array:5 [▶]
"startdate" => array:5 [▶]
"starttime" => array:5 [▶]
"enddate" => array:5 [▶]
"endtime" => array:5 [▶]
"breakdowndate" => null
"breakdowntime" => null
"Add" => "Submit"
]
所以请忽略这个问题
- 1 回答
- 0 关注
- 75 浏览
添加回答
举报
0/150
提交
取消