php - Laravel 5.7 - Redirect back to old tab and keep old value on each field
问题描述
I have code like this:
if ($validator->fails())
{
return back()
->withInput(['tab' => 'upload-doc'])
->withErrors($validator->errors());
}
and on my blade template, I have jQuery like this:
$(document).ready(function () {
$('#registrationTab a[href="#{{old('tab')}}"]').tab('show');
});
When I click submit button and validator invoked, I redirected to current tab, but my value on each field gone.
How to redirect back to old tab and keep old value on each field?
解决方案
推荐阅读
- flutter - Flutter StatefulWidget 无限次重建
- c# - 有没有办法从内存中获取修改后的字符串?
- kotlin - 在 Kotlin 中为两个以上的房间实体创建关系
- jenkins - Jenkins Pipeline - attachmentsPattern(外部工作区)
- c++ - 具有唯一指针的 set 函数给出错误 c2280
- c# - 具有 CancellationTokenSource 的通道在处理后具有超时内存泄漏
- css - CSS中与容器相同的列宽仅与子项的组合宽度一样宽
- c++ - 浏览器中使用 UE4 的套接字连接失败
- cassandra - 当我将小型 SSTBLS 流式传输到 Cassandra 4-rc1 时,我得到“流失败”。任何解决方法
- opc-ua - 正确解释事件的服务器响应