Reply To: clone a row with dropdown – and new dropdown becomes un clickable

#10033579
pellesoft
Participant

it strange that the code cannot be pasted…



                                        $(function () {
                                        // lägger till och raderar rader
                                            $('#addMore').on('click', function () {

                                             
                                             var data = $("#tb tr:eq(1)").clone(true).appendTo("#tb");
                                             data.find("input").val('');

                                         });
                                         $(document).on('click', '.remove', function() {
                                             var trIndex = $(this).closest("tr").index();
                                                if(trIndex>1) {
                                                 $(this).closest("tr").remove();
                                               } else {
                                                 alert("Du kan ej radera första raden. Du kan ta bort innehållet i fälten om du inte vill ha något data.");
                                               }
                                          });
                                        });