묻고답하기

//자동완성    
$("#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 남기남
이민규 정말 죄송하다는 말씀 먼저 드리면서.. [3] 2007.08.10
장성곤 A:link / A:visited / A:active /A:hover 관해서... [1] 2007.08.10
도순기 창크기 변화에 따라 홈페이지 틀이 변화지 않게 하는 방법좀 알려주세요  
靑空 팝업 광고 없이 빠른 포워딩 해주는 곳좀 알려주세요.. [2] 2007.08.10
지그재그 도메인 팔려면 어떻게 해야 하나요?  
oumz 8pt의 비밀은 도데체 무엇입니까!! [1] 2007.08.10
노경섭 [질문] PHP로 홈페이지 띄우기? [4] 2007.08.10
석이 포샵 6.0.1버전인데용..한글판을 ...영문판으루..바꿀려면.  
cowboy 최근게시물추출할때 리플은 추출되지 않게 하고 싶습니다.(방명록 스킨)  
zylon php소스를 암호화 할 수 있나요? [4] 2007.08.10
이성수 [질문] 쿠키 지우기에 대해서 -_-;; [5] 2007.08.10
junic 윈2000에서 다른이름저장에서 비트맵으로만...  
윤수리 옆에 슬라이딩 메뉴만드는데 에러가나요...  
로나 홈피에서 웹정이 않보일때 어떻해야하나요-_-?? [1] 2007.08.10
zylon 키보드의 특정 키를 인식할려면 .. [1] 2007.08.10
번개도리 윈2000에서 서버 만드는법좀 알려주실분-사례함- [1] 2007.08.10
쫑아쫑아 스타일시트를 고칠때요 [5] 2007.08.10
미노우 [PHP질문] 문자열 자르기가 아닌 문자열 늘리기~~ [1] 2007.08.10
김민수 port 설정 문제가 ..... [1] 2007.08.10
김호조 질문 이요..... [1] 2007.08.10
ㅁ멍든딸기ㅁ ★ 부탁드려효. 이문제를 꼭.점. 갈켜주세요!! ★ -__ㅠ.. [2] 2007.08.10
김근순 쿠키관련 질문이요 도와주세요~ [1] 2007.08.10
원쉘 자바스크립트 두개 소스가있는데요......  
최석기 지성하지만 도와주실수 있나여....~~~ [2] 2007.08.10
쫑아쫑아 캡쳐를 하면 검게 되는 현상.. [2] 2007.08.10
보이드 눈을 깜박이는 얼굴 아이콘을 만들려고 하는데.. [1] 2007.08.10
철의바다 트래픽 적게 나오게 할려면 어케해야 되죠.?. ㅜㅜ [5] 2007.08.10
DJ.PZH 스크롤 관련 자바와 제로보드 가입폼 관련..; [2] 2007.08.10
용장우 질문이영~ 나모고수분들 답변부탁드려여 ^^ [1] 2007.08.10
임준환 [PHP 질문] GET 전송 방식에 대하여.. [1] 2007.08.10