|
 |
|
ใครมีสคริปต์ทีใช้กับ php ที่เมื่อเลือกจาก List Menu แล้วปรากฏข้อความด้นล่าง List Menu บ้างไหมคับ |
|
 |
|
|
 |
 |
|
ลองหาบทความเกี่ยวกับ ajex ดูครับ อาจช่วยได้ พอดีผมเขียน ajex ไม่เป็นก๊าบ
|
 |
 |
 |
 |
Date :
2009-08-26 17:44:34 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
<form name=f1>
<table>
<tr>
<td>Mobile
<select NAME="list1" ONCHANGE="return(clicklist(this));">
<option VALUE="0"> - Select Mobile - </option>
<option value="1">Nokia</option>
<option value="2">Siemen</option>
<option value="3">Motorola</option>
</select>
</td>
<td>Serie
<select NAME="list2">
<option VALUE=""> - Select Mobile Serie - </option>
</select>
</td>
</tr>
</table>
</form>
<script>
var a = new Array();
a[0] = new Array(1, " - Select Mobile Serie - ");
a[1] = new Array(
101,"3210",
102,"3310",
103,"8250"
);
a[2] = new Array(
201,"A30",
202,"C45",
203,"SL42",
204,"M50"
);
a[3] = new Array(
301,"T300",
302,"T190",
303,"V90",
304,"V8088"
);
function clearcombo(elem){
var i;
for (i = elem.options.length - 1; i >= 0; i--) elem.options[i] = null;
elem.selectedIndex = -1;
}
function populatelist2(elem, index){
for (var i = 0; i < a[index].length; i= i + 2){
elem.options[elem.options.length] = new Option(a[index][i + 1], a[index][i]);
}
}
function clicklist(elem){
clearcombo(document.f1.list2)
populatelist2(document.f1.list2, elem[elem.selectedIndex].value);
return true;
}
</script>
?>
ลองเล่นดูนะครับ
|
 |
 |
 |
 |
Date :
2009-08-26 18:55:27 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณเน้อ
|
 |
 |
 |
 |
Date :
2009-08-28 15:38:52 |
By :
yingthecob |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|