묻고답하기

//자동완성    
$("#product_name").bind("focus", function(){
      $(this).autocomplete({
        source:'autocomplete',
        minLength:2,
        select:function(event, ui){
        //  $('#product_name').val(ui.item);
          $(this).on('blur', function(){
            //alert($("#product_name").val());
            $(this).parent().next().next().children().first().val(ui.item.price);
          });
        }
      })
    });

  // +버튼 클릭시 tr라인 추가
  $("#addItemBtn").click(function(e){

      e.preventDefault();
      cnt = $(".tr_flag").length;
      //alert(cnt);
              


              //clone
              $.trClone = $("#memberTable tr:last").clone(true).html();
              $.newTr =   $("<tr class='tr_flag'>"+$.trClone+"</tr>");

              //  var lastItemNo = $("#memberTable tr:last").attr("class").replace("item","");

              // $.newTr.find(".pn").attr("id","product_name_"); //+cnt

              //append
              $("#memberTable").append($.newTr);

              //delete Button추가
              $.btnDelete = $(document.createElement("input"));
              $.btnDelete.attr({
                name:"btnRemove",
                type:"button",
                class:"btn btn-danger",
                value:"-"
              });

              $("#memberTable tr:last td:last").html("");
              $("#memberTable tr:last td:last").append($.btnDelete);

              $("#memberTable tr>td:last>input[type='button']").on('click', function(){
                $(this).parent().parent().remove();
              });

           });

 

  <div class="form-group">
            <h4> Add products</h4>
            <button id="addItemBtn">+</button>
            <table class="table col-sm-12" id="memberTable">

              <tr>
                <th>Product </th><th>Size &Color </th><th>Price </th><th>Quantity </th><th>Total </th><th>Sales Price </th><th>remove</th>
              </tr>



                  <tr>
                    <td>{!! Form::text('product_name',null,['class'=>'form-control pn', 'id'=>'product_name' ])!!}</td>
                    <td>
                      {!! Form::text('size_color',null,['class'=>'form-control'])!!}
                    </td>
                    <td>
                      {!! Form::text('price','0',['class'=>'form-control','id'=>'price','readonly'])!!}
                    </td>
                    <td>
                      {!! Form::text('quantity','0',['class'=>'form-control','id'=>'quantity'])!!}
                    </td>
                    <td>
                      {!! Form::text('total',null,['class'=>'form-control','id'=>'total','readonly'])!!}
                    </td>
                    <td>
                      {!! Form::text('sales_price',null,['class'=>'form-control'])!!}
                    </td>
                    <td>

                    </td>


                  </tr>






            </table>

 


Add product의 + 버튼을 누르면   테이블의  tr한줄을 clone으로 복사하는 기능인데요

 

여기 첫번째 input text에 jquery UI의 autocomplete 함수는동작되는데

 

추가되는 input text에도 똑같이 autocomplete함수가 동작하지 않습니다.

 

 

추가되는 텍스트 박스에도 똑같이 함수가 동작되게 하고싶은데 안되네요

 

 

어떻게든 동작하게 하고싶어서 id에 증가 값을 주고 해보기도 했는데 (함수를 여러개 만드는 방법) 그것도 동작을 안하더라구요  어떻게 해야 깔끔하고 쉽게 동작하게 할수 있을까요?

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
염소뒷다리 익스플로러에서만 글쓰기가 안됩니다. [12] 2015.10.14 by 콜롬보.
네이츠 elFinderXE 모듈 사용 하시는분 없나요?  
Sydneylove 회원목록 오류 관련 내용 입니다.  
고양이냥 ssl 인증서 rc4? 떄문에 B 등급이 나온거 같은데.. [3] 2015.10.14 by 고양이냥
Chris Jeong Gmail SMTP를 사용해서 관리자 메일 자동 전송하기 [2] 2015.10.14 by Chris Jeong
po**** 업데이트 하다가 다음과 같은 에러 메세지가 나왔습니다. [1] 2015.10.14 by 기진곰
정선생 브라우저 언어에 따른 접속 주소 변경 문의 [2] 2015.10.14 by 정선생
최태진814 이미지 바로 본문삽입 않되나요?? [4] 2015.10.14 by YJSoft
최태진814 위젯 내용 직접 추가 이미지 질문 [2] 2015.10.14 by 최태진814
메롱 플래시 문제 부탁드립니다.  
굿컵7 관리자 복구 도움요청 합니다~ [7] file 2015.10.14 by Hjuy
고양이냥 ssl 인증서를 구입했는데 보안 인증서에 문제가 있다고 나와요.ㅜㅜ [2] 2015.10.14 by 고양이냥
xe어려워요 xe초보자가 겪고있는 오류들입니다. 답변좀 부탁드릴께요 ㅠㅠ file  
박효진 XE 1.5 게시물 제목 동일하게 고정할수 있나요?  
newi 게시판 짧은 주소 문의  
newi 그림 그리기 게시판 은 없나요??  
꿈꾸는돌 xe 공식홈 '다운로드' 처럼 카테고리를 서브메뉴로 출력할 수 있나요? [4] 2015.10.14 by Double'U'
슈니슈니 아이프레임 부모창을 새로고침 하는법 아시는분 [3] 2015.10.14 by Double'U'
sage하늘 메뉴 메인 글자색 바꾸는 방법을 알려주세요.  
25시 게시판 조회수 문제 해결된 줄 알았는데 도로 마찬가지