I am using this plugin
Now I am making a way to clone the select dropdown. Button for adding cloned divs. So, the user has an initial drop-down list, but he can add more. The div key is cloned.
The main problem is that when I clone a div, the combobox is associated with the initial combobox, not the new cloned one. Result: all drop-down lists of new cloned divs have an event to open the selected one associated with the first.

Script to call the plugin
<script language="javascript" type="text/javascript"> $(document).ready(function() { $(".mydds").msDropDown(); }) </script>
Script for cloning
<script type="text/javascript"> $(document).ready(function() { $('#adicionar').live('click', function(){ var num = $('.linguas').length; var newNum = new Number(num + 1); var newElem = $('#copiar' + num).clone(true).prop('id', 'copiar' + newNum); newElem.children(':text').prop('name', "myformdata[languages" + newNum + "]").prop('languages', 'languages' + newNum).val(''); $('#copiar' + num).after(newElem); $('#apagar').prop('disabled', ''); }); </script>
Any idea to solve the problem? Basically, I think the event associated with the dropdown is not copied ... thanks
source share