2011-07-31 4 views
0

일부 h 필드에 입력하고 PHP에서 모든 값을 게시하는 html 페이지가 있습니다. 여기 내 html 코드이다 : 나는 새로운 판자를 추가테이블에서 PHP로 배열을 게시

 <form action = 'preViewTallyHdr.php' method = 'POST' target="_blank"> 
     <p>Supplier Name & contact person: 
      <input class = 'supplier' type = 'text' id = 'supplierInput' value = '' STYLE="color: blue"; size="47" name = "supplier"> 
     </p> 
     <p>Wood specie description: 
      <input class = 'woodSpe' type = 'text' id = 'woodSpecie' value = ''STYLE="color: blue"; size = "55" name = "wood"> 
     </p> 
     <!--this is for viewing newly added planks (jqgrid)--> 
     <table id="plankList" name="plankList[]"></table> 
     <div id="pgrid"></div> 

     <!--this button will open another dialog (dialogAdd) for adding new plank-->   
     <input type ='button' id="btnAddnew" value = 'Add Plank'> 
     <input type = "Submit" value="Preview"> 
    </form> 

    <div id="dialogAdd" title="Plank Entry"> 
     <form method="post" action="#" id="plank_form">   
     <p>Plank number : 
     <input type="text" class="integer" name="plank_number" id="plank_number"/></p> 
     <p>Thickness: 
     <input type="text" class="numeric" name="thickness" id="thickness"/></p> 
     <p>Width: 
     <input type="text" class="numeric" name="width" id="width"/></p> 
     <p>Length: 
     <input type="text" class="numeric" name="length_t" id="length_t"/></p> 
     <p>Quantity: 
     <input type="text" class="integer" name="quantity" id="quantity"/></p> 
     </form> 
    </div> 

Evrytime, 내있는 jqGrid에서이 TI 디스플레이와 같은 배열을 만들 :

[{"plank_number":"1","thickness":"5","width":"7","length_t":"8","quantity":"1"}, 
{"plank_number":"2","thickness":"5","width":"6","length_t":"7","quantity":"1"}, 
{"plank_number":"3","thickness":"6","width":"7","length_t":"8","quantity":"1"}] 

을 얼마나 많은 판자에 사용자 입력을 따라 계속합니다.

이미 내 공급 업체 및 목재 종을 출력 할 수있는 .php 파일이 있지만 거기에 내 게시 테이블 데이터를 표시하는 방법을 모릅니다. 아래는 PHP 코드 (테이블 표시를위한 코드 없음)입니다.

<p>Supplier Name & contact person:<?php echo $_POST['supplier'];?><br/> 
     </p> 
    <p>Wood specie description:<?php echo $_POST['wood'];?> 
     </p> 
    <?php 
     //this is for my table which i don't know how to start 
    ?> 

또한 내 데이터에서 테이블을 만들 수 있습니까?

답변

0
<table id="plankList" name="plankList[]"></table> 

나는 HTML 마크 업이 옳다 위의 경우 ..

모르겠어요 그리고 당신이

[{"plank_number":"1","thickness":"5","width":"7","length_t":"8","quantity":"1"}, 
{"plank_number":"2","thickness":"5","width":"6","length_t":"7","quantity":"1"}, 
{"plank_number":"3","thickness":"6","width":"7","length_t":"8","quantity":"1"}] 

같은 배열 또는 JSON 형식이있는 경우 Ajax 요청이 게시 할 수 있습니다 (jquery).

+0

나는 또한 그 중 하나를 시도했지만 내'planklist' 배열을 호출하여 그리드에 넣는 법을 모릅니다. – jayAnn

+0

jqgrid의 API 문서를 확인하셨습니까? [http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options] – Nick

관련 문제