I have two select elements. When you select the first choice, options for the second choice will be created. Works well on desktop browsers.
On the iPhone, after you make your selection on the first and select "Next", the options will not be filled in the second selection. So far, the only ways to do this is to switch from the second choice, return to the “previous” one, and then return, “Next” to the second choice. Another way is to click Finish, and then touch the second selection.
I tried both .change () and .click (), and both of them give the same results.
Below is JS, and here is a working example http://damonomania.com/select/
Any suggestions? TIA!
$(document).ready(function(){
$('#select-1').change(function() {
show_options();
});
function show_options() {
var id = $('#select-1').val();
$('#select-2 option:gt(0)').remove();
$.each(options[id], function(k,v) {
$('#select-2').append('<option value="' + k + '">' + v + '</option>');
});
}
});
var options = {"17":{"835":"870","836":"871"},"18":{"435":"870","436":"871"},"13":{"1":"123546"},"19":{"1213":"4010","1206":"4015"}}