Created
July 29, 2013 09:16
-
-
Save nmoliveira/6103153 to your computer and use it in GitHub Desktop.
Dynamic <select> with Zurb Foundation Custom Forms. Requires jQuery.
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
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