I have two dropdown lists as shown in the below JSFiddle:
https://jsfiddle.net/jkw8fxzf/4/
HTML:
<select id="first-choice">
<option value="English">English</option>
<option value="Spanish">Spanish</option>
</select>
<select id="second-choice">
<option value="Spanish">Spanish</option>
<option value="English">English</option>
</select>
JS:
$("#first-choice").change(function() {
var userSelected = $(this).val()
alert(userSelected);
});
What I'm trying to do is as follows: If the users first-choice is English, then only display Spanish as an option in the second-choice dropdown. If the users first-choice is Spanish, then only display English in the second-choice dropdown.
Any thoughts on how to do this. Normally I would use an AJAX request and then catch the user selected paramater in the controller but since this is a devise registrations controller I've had issues overriding it.