Please put the code here.
Nov 3, 2019
5
Level 1
How to retain the selected option from a dropdown menu on page load
I was able to retain the inputted text in the two text fields, but I can't seem to get it to work with the drop down menu.
Level 1
<div class=" d-inline-block">
<select class="form-control custom-select" name="operators" value="{{ Session::get('operators')}}">
<option value="+" id="plus" name="plus" {{ Session::get('operators') == '+' ? 'selected' : '' }}>Addition (+)</option>
<option value="-" id="minus" name="minus" {{ Session::get('operators') == '-' ? 'selected' : '' }}>Subtraction (-)</option>
<option value="*" id="times" name="times" {{ Session::get('operators') == '*' ? 'selected' : '' }}>Multiplication (*)</option>
<option value="/" id="divide" name="divide" {{ Session::get('operators') == '/' ? 'selected' : '' }}>Division (/)</option>
</select>
Please or to participate in this conversation.