Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

data showing in single option instead of multiple option from json array

let statePicker = $('#statePicker').val();
let list = $("#cityPicker");
$.each(res.states, function(key, value) { 
    if (value.state == statePicker) {
        $.each(items, function(item) {
          list.append(new Option(item, item));
        });
    }
});
 
PREVIOUS NEXT
Tagged: #data #showing #single #option #multiple #option #json #array
ADD COMMENT
Topic
Name
5+9 =