[英]DatePicker - how to keep the selected value after clicking on submit button
[英]Select2 - There is no selected value in the selection field after clicking the submit button
我的選擇有問題。 當我選擇選項並單擊提交按鈕時,所選值將丟失。
{{ Form::open(['url' => route('index'), 'method' => 'GET', 'class' => 'form']) }} {{ csrf_field() }} <select class="form-control select2" data-tags="true" data-placeholder="Select filter" data-allow-clear="true" name="filterClients" id="filterClientBy" style="width: 100%;"> <option></option> <option name="firstCalling" value="firstCalling" {{Request::has('firstCalling')?'selected':''}}>First callin</option> <option name="firstVisit" value="firstVisit"{{Request::has('firstVisit')?'selected':''}}>First visit</option> </select> <button type="submit" id="apply" class="btn btn-success">Apply filters</button> {{ Form::close() }}
代替<form>
使用<form action="name of file or #" method="post or get ">
表單submit
是一種頁面刷新。 嘗試使用ajax請求submit
表單
<form onsubmit="yourFunctionName()">
// rest of the form
</form>
function yourFunctionName(e){
event.preventDefault();
//here ajax code to submit the form value
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.