Ensure that the Select Language option is always visible to the user, even after selecting Option 1 or Option 2 from the list.
Solution:
- If your dropdownlist does not have autopost back enabled:
Keep a hidden field where you can store the selected value, index, or text when the dropdownlist's change event triggers, in order to remember the selection.
For example, if your dropdownlist has the id sel and the hidden field is hdSel, the jQuery code should look like this:
$('#sel').change(function(){
var val = $("#sel option:selected").text();
$('#hdSel').val(val);
$("#sel").prop('selectedIndex', 0);
}
);
Check out this Jsfiddle example for better understanding
- If your dropdownlist has autopostback enabled, you can save the selected value, text, or index in the hidden field and then reselect the first item.
I hope this helps!