Hadomi Linux
Maluk parese hanoin oinsa bele hamosu dadus ba textbox liu husi combobox.,keta laran triste tamba listing iha kraik ne bele ajuda ona ita bot nia pergunta iha leten ne.
molok atu kopy listing iha kraik maluk sira tenki iha ona database iha xampp no iha mos tabela ida.,karik sedauk iha maluk sira bele kria tia lai molok atu kontinua ba prosesu tuir mai.
Ba maluk sira nebe iha ona database no tabela bele troka deit naran database no naran tabela iha kraik.......hehehe viva linux...hadomi linux go go go
<?php
mysql_connect("localhost","root","");
mysql_select_db("db_inventory");
$result = mysql_query("select * from sasan_tama");
$jsArray = "var prdName = new Array();\n";
echo '<table align="center">';
echo '<tr>';
echo '<td>kode_sasan<td>:<td> <select name="kode_sasan" onchange="changeValue(this.value)">';
echo '<option>-------</option>';
while ($row = mysql_fetch_array($result)) {
echo '<option value="' . $row['kode_sasan'] . '">' . $row['kode_sasan'] . '</option>';
$jsArray .= "prdName['" . $row['kode_sasan'] . "'] = {miez:'" . addslashes($row['naran_sasan']) . "',de:'".addslashes($row['kategoria_sasan'])."',hard:'".addslashes($row['husi'])."'};\n";
}
echo '</select>';
?>
<tr>
<td>
Naran_sasan<td> :<td> <input type="text" name="naran_sasan" id="naran_sasan"/>
<tr>
<td>
Naran Kategoria <td>: <td><input type="text" name="kategoria_sasan" id="kategoria_sasan"/>
<tr><td>
husi <td>:<td> <input type="text" name="husi" id="husi"/></td></tr>
<script type="text/javascript">
<?php echo $jsArray; ?>
function changeValue(id){
document.getElementById('naran_sasan').value = prdName[id].miez;
document.getElementById('kategoria_sasan').value = prdName[id].de;
document.getElementById('husi').value = prdName[id].hard;
};
</script>
hadomi linux
Monday, April 11, 2016
Subscribe to:
Post Comments (Atom)
0 komentariu:
Post a Comment