Skip to content

Instantly share code, notes, and snippets.

@nmoliveira
Created July 29, 2013 09:16
Show Gist options
  • Save nmoliveira/6103153 to your computer and use it in GitHub Desktop.
Save nmoliveira/6103153 to your computer and use it in GitHub Desktop.
Dynamic <select> with Zurb Foundation Custom Forms. Requires jQuery.
var selectvalues = { "1": "item 1", "2": "item 2", "3": "item 3"};
var $dropdown = $('#dropdown');
$.each(selectvalues, function(key, value) {
// add to dropdown
$dropdown
.append($('<option>', { value : key })
.text(value));
});
// refresh the elements on zurb dropdown
Foundation.libs.forms.refresh_custom_select($dropdown, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment