<div class="card-body">
<form action="" >
<div class="row">
<div class="col-5">
<label for="">From Date</label>
<input type="date" class="form-control" name="from" id="from" value="{{old('from')}}" required>
</div>
<div class="col-5">
<label for="">To Date</label>
<input type="date" class="form-control" name="to" id="to" value="{{old('to')}}" required>
</div>
<div class="col2 pt-4 mt-2">
<input type="submit" class="btn btn-success" value="search">
</div>
</div>
</form>
</div>,我要我的从数据提交后。我使用get请求搜索数据,并使用旧的搜索数据()的from日期字段刷新页面。
发布于 2021-06-15 22:00:29
据我所知,您希望在页面上显示新数据,而(从和到)是来自您之前的请求吗?
那么,为什么不使用新数据从将和从返回到。
<input type="date"
class="form-control"
name="from"
id="from"
value= @if($from) "{{$from}}" @endif required>
<input type="date"
class="form-control"
name="to"
id="to"
value= @if($to) "{{$to}}" @endif required>从控制器返回您想要返回的数据。
https://stackoverflow.com/questions/67992126
复制相似问题