Hi,
Is there an easy way to clone an existing chosen select box?
I really need this feature...
Someone has done something similar?
Thanks!
That's really easy
oh yea?
I'd love to see this working, currently I have to resolve to dirty hacks. Basically I have to clone the whole element containing the chosen'ed dropdown list and the new one is no longer functioning.
I can't believe this is an uncommon requirement, I'm using this for a generic type of form where you can add more elements.
Hi. I used some jQuery to make it work.
In your code where you add the cloned elements just add these:
$("#" + currentRow+ " select").removeClass("chzn-done").removeAttr("id").css("display", "block").next().remove();
$("#" + currentRow+ " select").chosen();
In my code I use currentRow to select only the last inserted form.
@harfyt , it works!
@harfyt works well! Cheers!
Closing this since it is solved outside of Chosen code.
Most helpful comment
Hi. I used some jQuery to make it work.
In your code where you add the cloned elements just add these:
$("#" + currentRow+ " select").removeClass("chzn-done").removeAttr("id").css("display", "block").next().remove();
$("#" + currentRow+ " select").chosen();
In my code I use currentRow to select only the last inserted form.