drop down menu - Jquery clone not passing dropdown selected value -


i have form lot of fields (input text , dropdown) , want clone fields onto other fields. fields combination of database-populated , on-the-fly populated.

the jquery clone() works fine cloning pre-populated @ page load not @ on-the-fly user input. have found solution fields:

$('div.mystufftocopy').find('input:text').each(function() {     $(this).attr('value', $(this).val()); });  newdiv = $('div.mystufftocopy').clone(true); 

with "mystufftocopy" representing here div contains want copy.

after lot of research on dropdown issue, can't find solution works. fix @ https://github.com/spencertipping/jquery.fix.clone, seems accepted answer, doesn't make difference (since dropdown cloned correctly when prepopulated @ page load). there way same trick input fields?

edit: here jsfiddle see want achieve: if modify first line of fields , click "copy" link, you'll see 2 inputs copied (thanks few js lines @ top) not dropdown.

edit2: have found way make work (here) weird thing dropdown clone has correct value selected doesn't show on screen (on chrome , firefox) - when submitting form post value show it's correct. how can force dropdown show real value?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -