Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
I need to show two different sets of iconfonts showing on the same page with two different names but unsure about the javascript side of it and how to do it

I have the following

Code: Select all
<script>
            $(function() {
                $(".icon-, #f_social_icons select[id$=-social_icon], #f_computer_repair_about_boxes_icons select[id$=-computer_repair_box_icons]").chosen();

                $("#addRow_f_social_icons, #addRow_f_computer_repair_about_boxes_icons").on("click", function() {
                    $("#f_social_icons select[id$=-social_icon]:last, #f_computer_repair_about_boxes_icons select[id$=-computer_repair_box_icons]:last").chosen();
                });
            });
        </script>


It shows the icons ok for the first select dropdown, the social icons one but the second one select dropdown, it only shows the icon names and not the icons themselves and think it's to do with the javascript code being wrong
Sorry sussed it with the following code

Code: Select all
<script>
            $(function() {
                $(".icon-, #f_social_icons select[id$=-social_icon]").chosen();
            
            $(".icon-, #f_computer_repair_about_boxes_icons select[id$=-social_icon]").chosen();

                $("#addRow_f_social_icons").on("click", function() {
                    $("#f_social_icons select[id$=-social_icon]:last").chosen();
                });
            
            $("#addRow_f_computer_repair_about_boxes_icons").on("click", function() {
                    $("#f_computer_repair_about_boxes_icons select[id$=-social_icon]:last").chosen();
                });
            });
        </script>
2 posts Page 1 of 1