zurb/foundation — pull request #123 by sbarre (2011-11-25 18:28:36+00:00)
Title: added method to re-sync custom drop-downs if native element changes

I'm not sure if this would work for everyone, but I added a refreshSelect() method to jquery.customforms.js that gets attached to the change event of the native select to re-populate and re-flow the custom select in the event that the native hidden form element changes.

This is useful to me because I use Ajax methods to update the contents of selects in my forms (like the typical "change country, update states/provinces" scenario) and I need the custom drop-down to re-render if the contents of the native drop-down changes.

Note that you must actually call $el.trigger("change") in your code that re-populates the select because changing a select in code doesn't trigger the change event automatically (boooo!)