We'll got stuck my self in adding row using javascript, It seemed doesn;t work at a time I click on the button "tambah Barang" do I missed something..??please help.. Thanks <?php include_once "config.php";?> <script type="text/javascript" src="../jquery/jquery.min.js"></script> <script type="text/javascript"> var idrow = 2; function tambah() { var x=document.getElementById('datatabel'); var td1=x.insertCell(0); var td2=x.insertCell(1); var td3=x.insertCell(2); var td4=x.insertCell(3); var td5=x.insertCell(4); td1.innerHTML="<select name='nama[]' onchange='document.getElementById('harga').value=prdName[this.value]'><?php $result = mysql_query("select * from barang"); echo "<option>-------</option>"; while ($row = mysql_fetch_array($result)) { echo "<option value='".$row['brg_id']."'>" . $row['brg_nm_barang']."</option>"; $jsArray .= "prdName['" . $row['brg_id'] . "'] = '" . addslashes($row['brg_harga']) . "';\n"; } ?></select>"; td2.innerHTML="<input type='text' name='harga[]' size='20' id='harga' class='harga'/>"; td3.innerHTML="<center>x</center>"; …

Member Avatar
Member Avatar
+0 forum 2

The End.