I apologize if this has already been answered. I'm still kind of learning as I go. I have searched and been unable to find a solution that works for me. I had found this one:
Firefox ignores option selected="selected"
But adding autocomplete="off" did not work for me.
Users should be able to choose an option, submit, and then when they go back have their selected option be available. This is currently working in Safari, Chrome, and Opera but not working in Firefox or IE. The select works fine, but it doesn't automatically select their choice when they go back.
I have another select on the same page which doesn't appear to have the same issue.
Here is the HTML:
<div class="col-sm-2 col-md-2">
<div class="form-group">
<label for="custom_1_units">Units</label>
<select class="form-control" id="custom_1_units" name="custom_1_units" value="<?php echo"_SESSION['Custom']['custom_1_units'];" ?>" autocomplete="off">
<option value="pages">pages</option>
<option value="lessons">lessons</option>
<option value="activities">activities</option>
<option value="units">units</option>
<option value="projects">projects</option>
</select>
</div>
</div>
And here is the PHP/Javascript. It's on a .php file:
<?php echo "var cus_1_units ='" . $_SESSION['Custom']['custom_1_units'] . "';"; ?>
$("#custom_1_units").each(function() {
if($(this).text() == cus_1_units) {
$(this).attr('selected', 'selected');
}
});