묻고답하기

//자동완성    
$("#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 남기남
JAYLEEKOREA 이 게시판 모듈이 뭔가요? [5] file 2015.10.29 by Chuu98
npr05324 푸시 알림 사용시 DB 관련 오류가 발생합니다. [1] 2015.10.29 by Chuu98
seacloud 설치화면이 안보여요. 서버가 index.php를 못읽네요 [7] 2015.10.29 by Chuu98
플레이앱 XE Recruitment 커스텀 관련  
xe사용자권한 구글애드센스 기입할려고하는데 알려주세요 ㅠ [1] 2015.10.29 by I-JEX
키쨩 동영상같은거올릴때 게시글옆에 사진뜨게하는법없나요 ?  
도르르 홈페이지 파일 업로드 문제입니다 [1] 2015.10.29 by 도르르
xe사용자권한 oops! 잘못된요청입니다. [3] file 2015.10.29 by sports21
sports21 게시판에 파일 첨부시 오류 [2] file 2015.10.29 by sports21
tsoj XEDITION v1.9에서 content 위젯 사용할 경우 이미지 이름  
Paul [DB] xe_document_histories 라는 곳에 있는 것들을 지워도 되나요? [2] 2015.10.29 by Paul
졸라맨 아이디 찾기, 비밀번호 찾기 이메일 발송이 잘되던게 안되네요.ㅠㅠ [2] 2015.10.29 by 졸라맨
푸우143d7 회원가입 페이지 링크 오류 [1] 2015.10.29 by Chuu98
0201 외부 API를 XE 게시판으로 출력하고 싶은데 어떻게 해야할까요? [5] 2015.10.29 by Chuu98
thdwjdtjr 사진게시판에 에러발생합니다....도와주세요.... [2] file 2015.10.28 by thdwjdtjr
짱구삼촌 contact 메일이 안들오는데 어떻게 하면 되져? [2] 2015.10.28 by 로이조52
큐원 the dreamer 모바일 레이아웃에서 "pc버전" 메뉴를 만들려면 어떻게 해야되요? [2] 2015.10.28 by 큐원
clara www.주소. com/xe/로 설치 했을 경우 index 에서 로그인 나오게 하는 방법 [3] 2015.10.28 by clara
샵사이드 일본 서버 호스팅 추천좀 부탁드립니다. [3] 2015.10.28 by 기진곰
gobulldozer 게시판 제작편집/ 메뉴편집을 누르면 접속 X [2] file 2015.10.28 by 키큰아이
c34c0 로그인 에러.. [3] file 2015.10.28 by treasurej
키큰아이 아래 내용을 애드온으로 대체하려고하는데... [2] 2015.10.28 by 키큰아이
사람사는좋은세상 통합검색 에러메세지 [1] file 2015.10.28 by 불금
밥탱이 게시글 밴드 공유하면 글자가 깨져 보여요 [2] 2015.10.28 by 밥탱이
2ndLee 게시판 설문조사 확장컴포넌트 도와주세요. [1] 2015.10.28 by EISOFT
orijung 게시판 내용이 길어지면 화면 밖으로 벗어납니다ㅠㅠ [1] file 2015.10.28 by DoorWeb
sage하늘 서브메뉴 수정하는거 알려주세요! 사진참고해주세요! [1] file 2015.10.28 by DoorWeb
보리보리 메인메뉴 아래 이벤트 페이지를 만드는 방법을 알려주세요 file  
마키치노 회원가입시, 글 작성시, 로그인 시 빈화면 이동...  
로스트(ROST) XE CON 2015 에 관하여 [1] 2015.10.27 by 기진곰