【发布时间】:2018-11-07 10:13:01
【问题描述】:
我有一个类似这样的 URL:foo?country=usa&state=ny 和 foo 我有一个表单,它为我提供了 firstname 和 lastname 的值,还有一些带有提交按钮的值。
但是当我点击submit 时,它会给出foo?firstname=john&lastname=doe
而另一个查询,即国家和州消失,或者换句话说,我正在失去它们。
任何人都可以告诉我,即使我正在提交表单,我该如何保留它们?
请注意:我不能使用任何隐藏字段,因为 foo Blade 中有很多表格,而且 foo Blade 可以有很多查询,而不仅仅是国家和州,可能还有年龄,邮政编码等
我在 foo.blade.php 中的表单是这样的
<form method="get" action ="{{Request::fullUrl()}}">
<div class="form-group">
<input type="text" class="form-control" name="firstname" placeholder="first name">
</div>
<button type="submit" class="btn btn-green-small">Apply</button>
</form>
//Another form
<form method="get" action ="{{Request::fullUrl()}}">
<div class="form-group">
<input type="text" class="form-control" name="lastname" placeholder="first name">
</div>
<button type="submit" class="btn btn-green-small">Apply</button>
</form>
【问题讨论】:
-
您可以追加现有请求。检查这个:stackoverflow.com/questions/37107903/…
-
@tech2017 那是为请求数组增加价值,但我要问的是来自页面
标签: php html laravel laravel-5