using jQuery, how can you create a clone of a form without modifying the original form when a different value is selected in the clone. Currently, when selecting a value in the cloned form, the results that is returned is added to the results of the clone, as well as the original. I only want to results to appear for each unique form. Here is what i have:
<script>
$(document).ready(function() {
shows / hides results based on selection
$(".color-select").live("change" ,function(){
if($(this).val() == 'red'){
$('.red').removeClass('hide');
// toggles sub menus
$(this).parent('.controls').find('.submenu-select').removeClass('hide');
}
if($(this).val() == 'orange'){
$('.orange').removeClass('hide');
$(this).parent('.controls').find('.submenu-select').addClass('hide');
}
if($(this).val() == 'yellow'){
$('.yellow').removeClass('hide');
$(this).parent('.controls').find('.submenu-select').addClass('hide');
}
if($(this).val() == 'green'){
$('.green').removeClass('hide');
$(this).parent('.controls').find('.submenu-select').addClass('hide');
}
});
;
// Duplicates category select menu
$(".add-color").click(function(){
$(".color-category").clone().removeClass('color-category').appendTo("#we-want-to").find('.submenu-select').addClass('hide');
});
$(".add-color-alternate").click(function(){
$(".color-category-alternate").clone().removeClass('color-category-alternate').appendTo("#we-want-to").find('.submenu-select, .results-table').addClass('hide');
});
Heres a fiddle with some html http://jsfiddle.net/mckenney42south/Z4yFs/
Thanks!