I have a popup form which populates the <options>
of a <select>
from its parent form. Each <option>
has a different value
from the text displayed.
However, if I programmatically set the selected option in the popup via:
$("#id option[val='" + window.opener.$("#id").val() + "']").prop('selected', true);
Then jQuery sets the option value in the popup form to that of the option text in the parent form.