|
 |
|
รบกวนช่วยดูโค้ดให้หน่อยค่ะว่าผิดตรงไหน select ข้อมูลจาก databaseมาโชว์ แต่ข้อมูลขึ้นสลับกันค่ะ |
|
 |
|
|
 |
 |
|
ถ้าเป็นผมจะทำมาลักษณะนี้ครับ
Code (PHP)
<form name="frmMain">
<table>
<tr>
<td>
<select name="atm" onchange="resutName(this)">
<option value="" atm_price="" atm_price_sh="">กรุณาเลือก</option>
<option value="1" atm_price="5000" atm_price_sh="50,000.00">xxxxxx</option>
<option value="2" atm_price="6000" atm_price_sh="60,000.00">yyyyyy</option>
<option value="3" atm_price="7000" atm_price_sh="70,000.00">zzzzzzz</option>
</select>
</td>
<td>
<input name="atm_price_sh" type="text" disabled="disabled" id="atm_price_sh" value="<? echo number_format($atm_price,2) ?>" size="10" />
<input name="atm_price" type="hidden" id="atm_price" value="<? echo $atm_price?>" />
</td>
</tr>
</table>
</form>
<script>
function resutName(obj){
document.frmMain.atm_price.value=obj.options[obj.selectedIndex].getAttribute("atm_price");
document.frmMain.atm_price_sh.value=obj.options[obj.selectedIndex].getAttribute("atm_price_sh")
}
</script>
|
 |
 |
 |
 |
Date :
2013-09-21 17:24:58 |
By :
ผ่านมา |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|