Created
May 6, 2014 17:44
-
-
Save arielcr/160d1e5cfc75903e2185 to your computer and use it in GitHub Desktop.
Populate select box from JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON('select.php', {customerId: $(this).val()}, function(data){ | |
var vehicle = $('#vehicle'); | |
for (var x = 0; x < data.length; x++) { | |
vehicle.append(new Option(data[x].reg, data[x].id)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment