i have a form with a select input, validation is fine, but upon failure the select field doesn't populate the old value here is my select field
<div class="control-group">
<label class="control-label">Gender :</label>
<div class="controls">
<select name="gender" value= "{{ Input::old('gender') }}">
<option>Select</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</div>
</div>
how can i solve this?
If you don't want to use Laravel Form build, you need to do it this way:
<div class="control-group">
<label class="control-label">Gender :</label>
<div class="controls">
<select name="gender">
<option>Select</option>
<option value="M" @if (Input::old('gender') == 'M') selected="selected" @endif>Male</option>
<option value="F" @if (Input::old('gender') == 'F') selected="selected" @endif>Female</option>
</select>
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With