0
有這個html頁面,我在某些字段中輸入並在php中發佈所有值。這裏是我的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
?>
還有,我也可以根據我的數據製作一張表嗎?
我也試過那一個,但我不知道如何調用我的'planklist'數組,並把它放在一個網格中。 – jayAnn
你檢查了jqgrid的API文檔嗎? [http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options] – Nick