нет ничего плохого в вашем коде. Вы просто не понимаете логику правильно. Вот модифицированная версия вашего кода, который я написал. если это поможет вам, проголосуйте за меня. * 1001 спасибо *
//the blade form. the javascript gets the value of the selected item, assign it to the input box and submit your form automatically.
<form action="{{ route('penpal.index', ['list'=>$list,'page' => $page]) }}" method="post" id="submitForm">
{{ csrf_field() }}
<select id="inputState" class="form-control" style="height:35px; width:80%" name="list">
<option value="">-Please Select-</option>
<option value="12">@lang('penpal/component/indexMenu.twelve')</option>
<option value="24">@lang('penpal/component/indexMenu.twenty_four')</option>
<option value="36">@lang('penpal/component/indexMenu.thirty_six')</option>
</select>
<input type="text" class="form-control" id="valueid" name="id" value="">
</form>
//javascript code
<script>
$(document).ready(function(){
$("#inputState").change(function(e){
var value= e.target.value;
//alert(value);
document.getElementById('valueid').value = value; //assign select value to input field.
$('#submitForm').submit(); //submit form
});
});
</script>