html Laravel表单选择旧值+ db示例

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html Laravel表单选择旧值+ db示例相关的知识,希望对你有一定的参考价值。

<select name = "pick_up_country" id="f-sender-country">
  <option value="Ireland (Republic of)" @if ( $existingvalue->pick_up_country == 'Ireland (Republic of)') selected="selected" @elseif (Request::old('pick_up_country') == 'Ireland (Republic of)') selected="selected" @endif >Ireland (Republic of)</option>
  <option value="UK" @if ( $existingvalue->pick_up_country == 'UK') selected="selected" @elseif (Request::old('pick_up_country') == 'UK') selected="selected" @endif >UK</option>
  <option value="Germany" @if ( $existingvalue->pick_up_country == 'Germany') selected="selected" @elseif (Request::old('pick_up_country') == 'Germany') selected="selected" @endif >Germany</option>
</select>
  <input name= "delivery_county" type="text" id="-receiver-county" value = "{{ (Request::old('delivery_country')) ? Request::old('delivery_country') : $existingvalue->delivery_country }}">

以上是关于html Laravel表单选择旧值+ db示例的主要内容,如果未能解决你的问题,请参考以下文章

Laravel 8.65 验证错误消息和旧值未显示在 Blade 文件中

Laravel 在循环输入字段中获取旧值

如何在刀片 laravel 8 中获取选择输入的旧值?

laravel 刀片中多选选项中的旧值

数组合并递归旧值与新值

如何在 laravel 中以编辑形式显示时间戳格式?