 |
|
|
 |
 |
|
ลองดูนะที่นี่นะ
https://www.thaicreate.com/php/forum/017520.html
หรือ
https://www.thaicreate.com/php/forum/012102.html
ผมเขียนไว้เอง ไม่รู้ว่าตรงตามต้องการเปล่า แต่จะมี dropdown 3 อันนะ
สงลัยตรงไหนมาถาม
|
 |
 |
 |
 |
Date :
2010-06-15 21:36:15 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ คุณ Heng สำหรับ code ที่แนะนำ
ผมเองยังไม่เก่งครับเลยดู code หน้าที่ให้มาไม่ค่อยเข้าใจ มีแบบง่ายกว่านี้ไหมครับ
เช่นแบบไม่ใช้ array อ่าครับผม
|
 |
 |
 |
 |
Date :
2010-06-16 20:30:43 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยตอบทีครับ
|
 |
 |
 |
 |
Date :
2010-06-17 10:01:52 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แปบนะ จะเขียนใหม่ ให้ง่ายๆ
|
 |
 |
 |
 |
Date :
2010-06-17 10:43:36 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ คุณ heng ตอนนี้ผมพยายามใช้ code คุณ heng ดัดแปลงอยู่ครับ
ยังไงช่วยหน่อยนะครับ
ปล. ขอบคุณครับคุณ heng
|
 |
 |
 |
 |
Date :
2010-06-17 10:49:19 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตัวอย่าง dropdown 3 อันนะ
Code (PHP)
<?
// กำหนดค่าตรงนี้
// กำหนดค่า dropdown 1
$table1 = "tb_room"; // ตารางที่ 1
$id1 = "room_id"; // ฟิวด์ id ของตารางที่ 1
$text1 = "room_num"; // ฟิวด์ ที่ให้แสดงใน dropdown 1
$value1 = "room_id"; // ฟิวด์ ที่ให้ค่า value dropdown 1
// กำหนดค่า dropdown 2
$table2 = "tb_lease"; // ตารางที่ 2
$id2 = "lease_id"; // ฟิวด์ id ของตารางที่ 2
$text2 = "lease_name"; // ฟิวด์ ที่ให้แสดงใน dropdown 2
$value2 = "lease_id"; // ฟิวด์ ที่ให้ค่า value dropdown 2
// กำหนดค่า dropdown 3
$table3 = "tb_bill_mrent";
$id3 = "Mbill_id";
$text3 = "Mbill_date";
$value3 = "Mbill_id";
?>
select1 = <?=$name1?><br />
select2 = <?=$name2?><br />
select3 = <?=$name3?><br />
<script type="text/javascript">
var select1_text = new Array();
var select1_value = new Array();
var select2_text = new Array();
var select2_value = new Array();
var select3_text = new Array();
var select3_value = new Array();
</script>
<form>
<select id="id_select[1]" name="name1" onchange="return show_select_next(1,2,select2_text,select2_value)"><option value="">select1</option></select>
<select id="id_select[2]" name="name2" onchange="return show_select_next(2,3,select3_text,select3_value)"><option value="">select2</option></select>
<select id="id_select[3]" name="name3"><option value="">select3</option></select>
<input type="submit">
</form>
Code (PHP)
<?
// ตรงที่คอมเมนต์ในส่วนนี้ ถ้าเอาออกจะเห็น ข้อมูลทั้งหมดตามลำดับชั้น
//echo "<br>";
$select1 = mysql_query("SELECT * FROM $table1");
for($s1=0;$s1<mysql_num_rows($select1);$s1++)
{
$arr_s1=mysql_fetch_array($select1);
//echo "=".$arr_s1[$text1];
?>
<script language="javascript">
select1_text[<?=$s1?>] = '<?=$arr_s1[$text1]?>';
select1_value[<?=$s1?>] = '<?=$arr_s1[$value1]?>';
select2_text['<?=$arr_s1[$value1]?>'] = new Array();
select2_value['<?=$arr_s1[$value1]?>'] = new Array();
</script>
<?
// echo "<br>";
$select2 = mysql_query("SELECT * FROM $table2 where ".$id1." = '".$arr_s1[$id1]."'");
for($s2=0;$s2<mysql_num_rows($select2);$s2++)
{
$arr_s2=mysql_fetch_array($select2);
//echo " '-- ".$arr_s2[$text2];
?>
<script language="javascript">
select2_text['<?=$arr_s1[$value1]?>'][<?=$s2?>] = '<?=$arr_s2[$text2]?>';
select2_value['<?=$arr_s1[$value1]?>'][<?=$s2?>] = '<?=$arr_s2[$value2]?>';
select3_text['<?=$arr_s2[$value2]?>'] = new Array();
select3_value['<?=$arr_s2[$value2]?>'] = new Array();
</script>
<?
//echo "<br>";
$select3 = mysql_query("SELECT * FROM $table3 where ".$id2." = '".$arr_s2[$id2]."'");
for($s3=0;$s3<mysql_num_rows($select3);$s3++)
{
$arr_s3=mysql_fetch_array($select3);
//for($nbsp=0;$nbsp<14;$nbsp++){if($nbsp==5 && $s2 < mysql_num_rows($select2) -1 ){echo "'";} echo " ";}
//echo "'-- ".$arr_s3[$text3]." ";
?>
<script language="javascript">
select3_text['<?=$arr_s2[$value2]?>'][<?=$s3?>] = '<?=$arr_s3[$text3]?>';
select3_value['<?=$arr_s2[$value2]?>'][<?=$s3?>] = '<?=$arr_s3[$value3]?>';
</script>
<?
// echo "<br>";
}
}
//echo "<br>";
}
?>
<script type="text/javascript">
var options1 = (parseFloat(select1_text.length)+1);
document.getElementById('id_select[1]').length = options1;
for(var ss1 = 1; ss1 < options1; ss1++)
{
document.getElementById('id_select[1]').options[ss1].text = select1_text[ss1-1];
document.getElementById('id_select[1]').options[ss1].value = select1_value[ss1-1];
}
function show_select_next(change_select,select_next,array_next,array_next2)
{
var id_next = select_next ;
while(document.getElementById('id_select['+id_next+']'))
{
document.getElementById('id_select['+id_next+']').length=1;
document.getElementById('id_select['+id_next+']').options[0].selected =true
id_next++;
}
var name_text ;
var name_value;
var num_options = (parseFloat(array_next2[document.getElementById('id_select['+change_select+']').value].length)+1);
document.getElementById('id_select['+select_next+']').length = num_options;
for(var nn = 1; nn < num_options; nn++)
{
name_value = array_next2[document.getElementById('id_select['+change_select+']').value][nn-1];
name_text = array_next[document.getElementById('id_select['+change_select+']').value][nn-1];
document.getElementById('id_select['+select_next+']').options[nn].text = name_text;
document.getElementById('id_select['+select_next+']').options[nn].value = name_value;
}
}
</script>
|
 |
 |
 |
 |
Date :
2010-06-17 13:37:50 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณ Heng เจ๋งไปเลยครับ ว่าแต่ให้ผมใช้ code ทั้งหมดเลยใช่ไหมครับ
|
 |
 |
 |
 |
Date :
2010-06-17 16:08:47 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตกลงใช้ได้แล้วใช่ไหม
เอามาแปะขนาดนี้แล้วคงไม่ให้มั่ง 
|
 |
 |
 |
 |
Date :
2010-06-17 17:44:55 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณ Heng ครับ ผมกำลังลองใช้ code จากลิ้งค์นี้อยู่ครับ
https://www.thaicreate.com/php/forum/017520.html
มันยัง error ใน dropdown ที่ 3 ครับ ยังไงเดี๋ยวผมลองแก้ดูก่อนนะครับ
ปล.ขอบคุณมากครับ คุณ Heng
|
 |
 |
 |
 |
Date :
2010-06-17 20:49:31 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณ Heng ครับ ผมทำได้แล้วครับแต่ว่าตอนนี้ ผมอยากได้เป็น 4 dropdown อ่าครับผม ช่วย
แนะทีครับว่าต้องเพิ่ม code ตรงไหนบ้าง
ปล.ขอบคุณ คุณ Heng ที่ช่วยตอบให้ครับ
|
 |
 |
 |
 |
Date :
2010-06-17 21:33:14 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
code ที่ https://www.thaicreate.com/php/forum/017520.html
ใน dropdown ค่า value กับ text จะเป็นค่าเดียวกัน
หมายถึง <option value="ค่า value">ค่า text</option>
เช่น value = a , text =a
แต่ code ที่เขียนให้ใหม่ จะแยกจากกัน
เช่น <option value="ค่า id">ค่า name</option> : value = 1 , text =a
จะกำหนดจากตรงนี้ได้เลยว่า ค่า text กับ value ดึงจากฟิวด์ไหน
$text1 = "room_num"; // ฟิวด์ ที่ให้แสดงใน dropdown 1
$value1 = "room_id"; // ฟิวด์ ที่ให้ค่า value dropdown 1
ลองดูนะ
|
 |
 |
 |
 |
Date :
2010-06-17 21:37:06 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
dropdown ตัวที่ 4 เดี๋ยวดึกๆ ทำไห้ ลืมบอก code นี้รันบน Firefox น่าจะไม่ได้
ถ้าต้องรันบน Firefox ด้วย ลองแก้ที่ javascript
จาก getElementById เป็น all ดูนะ =>document.all(...
|
 |
 |
 |
 |
Date :
2010-06-17 21:42:26 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
dropdown 4 อันมาแล้ว
Code (PHP)
<?
// กำหนดค่าตรงนี้
// ค่าตารางที่ 1
$table1 = "tb_room"; // ตารางที่ 1
$id1 = "room_id"; // ฟิวด์ id ของตารางที่ 1 (PK)
$text1 = "room_num"; // ฟิวด์ ที่ให้แสดงใน dropdown 1
$value1 = "room_id"; // ฟิวด์ ที่ให้ค่า value dropdown 1
// ค่าตารางที่ 2 : มี $id1 จากตาราง1 เป็น (FK)
$table2 = "tb_lease"; // ตารางที่ 2
$id2 = "lease_id"; // ฟิวด์ id ของตารางที่ 2 (PK)
$text2 = "lease_name"; // ฟิวด์ ที่ให้แสดงใน dropdown 2
$value2 = "lease_id"; // ฟิวด์ ที่ให้ค่า value dropdown 2
// ค่าตารางที่ 3 : มี $id2 จากตาราง2 เป็น (FK)
$table3 = "tb_bill_mrent";
$id3 = "Mbill_id"; // ฟิวด์ id ของตารางที่ 3 (PK)
$text3 = "Mbill_date";
$value3 = "Mbill_id";
// ค่าตารางที่ 4 : มี $id3 จากตาราง3 เป็น (FK)
$table4 = "tb_table4";
$id4 = "id";
$text4 = "name1";
$value4 = "id";
?>
<script type="text/javascript">
var select_text1 = new Array();
var select_value1 = new Array();
var select_text2 = new Array();
var select_value2 = new Array();
var select_text3 = new Array();
var select_value3 = new Array();
var select_text4 = new Array();
var select_value4 = new Array();
</script>
<form>
<select id="id_select[1]" name="name1" onChange="return show_select_next(1,2,select_text2,select_value2)"><option value="">select1</option></select>
<select id="id_select[2]" name="name2" onChange="return show_select_next(2,3,select_text3,select_value3)"><option value="">select2</option></select>
<select id="id_select[3]" name="name3" onChange="return show_select_next(3,4,select_text4,select_value4)"><option value="">select2</option></select>
<select id="id_select[4]" name="name4"><option value="">select4</option></select>
<input type="submit">
</form>
Code (PHP)
<?
$select1 = mysql_query("SELECT * FROM $table1");
for($s1=0;$s1<mysql_num_rows($select1);$s1++)
{
$arr_s1=mysql_fetch_array($select1);
?>
<script language="javascript">
select_text1[<?=$s1?>] = '<?=$arr_s1[$text1]?>';
select_value1[<?=$s1?>] = '<?=$arr_s1[$value1]?>';
select_text2['<?=$arr_s1[$value1]?>'] = new Array();
select_value2['<?=$arr_s1[$value1]?>'] = new Array();
</script>
<?
$select2 = mysql_query("SELECT * FROM $table2 where ".$id1." = '".$arr_s1[$id1]."'");
for($s2=0;$s2<mysql_num_rows($select2);$s2++)
{
$arr_s2=mysql_fetch_array($select2);
?>
<script language="javascript">
select_text2['<?=$arr_s1[$value1]?>'][<?=$s2?>] = '<?=$arr_s2[$text2]?>';
select_value2['<?=$arr_s1[$value1]?>'][<?=$s2?>] = '<?=$arr_s2[$value2]?>';
select_text3['<?=$arr_s2[$value2]?>'] = new Array();
select_value3['<?=$arr_s2[$value2]?>'] = new Array();
</script>
<?
$select3 = mysql_query("SELECT * FROM $table3 where ".$id2." = '".$arr_s2[$id2]."'");
for($s3=0;$s3<mysql_num_rows($select3);$s3++)
{
$arr_s3=mysql_fetch_array($select3);
?>
<script language="javascript">
select_text3['<?=$arr_s2[$value2]?>'][<?=$s3?>] = '<?=$arr_s3[$text3]?>';
select_value3['<?=$arr_s2[$value2]?>'][<?=$s3?>] = '<?=$arr_s3[$value3]?>';
select_text4['<?=$arr_s3[$value3]?>'] = new Array();
select_value4['<?=$arr_s3[$value3]?>'] = new Array();
</script>
<?
$select4 = mysql_query("SELECT * FROM $table4 where ".$id3." = '".$arr_s3[$id3]."'");
for($s4=0;$s4<mysql_num_rows($select4);$s4++)
{
$arr_s4=mysql_fetch_array($select4);
?>
<script language="javascript">
select_text4['<?=$arr_s3[$value3]?>'][<?=$s4?>] = '<?=$arr_s4[$text4]?>';
select_value4['<?=$arr_s3[$value3]?>'][<?=$s4?>] = '<?=$arr_s4[$value4]?>';
</script>
<?
}
}
}
}
?>
<script type="text/javascript">
var options1 = (parseFloat(select_text1.length)+1);
document.getElementById('id_select[1]').length = options1;
for(var ss1 = 1; ss1 < options1; ss1++)
{
document.getElementById('id_select[1]').options[ss1].text = select_text1[ss1-1];
document.getElementById('id_select[1]').options[ss1].value = select_value1[ss1-1];
}
function show_select_next(change_select,select_next,array_next,array_next2)
{
var id_next = select_next ;
while(document.getElementById('id_select['+id_next+']'))
{
document.getElementById('id_select['+id_next+']').length=1;
document.getElementById('id_select['+id_next+']').options[0].selected =true
id_next++;
}
var name_text ;
var name_value;
var num_options = (parseFloat(array_next2[document.getElementById('id_select['+change_select+']').value].length)+1);
document.getElementById('id_select['+select_next+']').length = num_options;
for(var nn = 1; nn < num_options; nn++)
{
name_value = array_next2[document.getElementById('id_select['+change_select+']').value][nn-1];
name_text = array_next[document.getElementById('id_select['+change_select+']').value][nn-1];
document.getElementById('id_select['+select_next+']').options[nn].text = name_text;
document.getElementById('id_select['+select_next+']').options[nn].value = name_value;
}
}
</script>
|
 |
 |
 |
 |
Date :
2010-06-17 23:10:40 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ คุณ Heng เดี๋ยวผมจะลองดูนะครับ
|
 |
 |
 |
 |
Date :
2010-06-18 15:52:45 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณ Heng ครับ รบกวนช่วยทำเป็น 5 dorpdown จากลิ้งค์ด่านล่างทีได้ไหมครับ
https://www.thaicreate.com/php/forum/017520.html
พอดีผมทำลิ้งนี้ได้ครับ
ปล. ขอบคุณ คุณ Heng ล่วงหน้าครับ
|
 |
 |
 |
 |
Date :
2010-06-19 15:20:28 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณ Heng ช่วยทีครับ
|
 |
 |
 |
 |
Date :
2010-06-22 15:24:33 |
By :
<- Pp -> |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
listbox 5 อัน ยังไม่ได้ทดสอบนะ
Code (PHP)
<?
// กำหนดค่าตรงนี้
// ค่า listbox 1
$table1 = "tb_room"; // ตารางที่ 1
$id1 = "room_id"; // ฟิวด์ id ของตารางที่ 1 (PK)
$text1 = "room_num"; // ฟิวด์ ที่ให้แสดงใน dropdown 1
$value1 = "room_id"; // ฟิวด์ ที่ให้ค่า value dropdown 1
// ค่า listbox 2 : มี $id1 จากตาราง1 เป็น (FK)
$table2 = "tb_lease"; // ตารางที่ 2
$id2 = "lease_id"; // ฟิวด์ id ของตารางที่ 2 (PK)
$text2 = "lease_name"; // ฟิวด์ ที่ให้แสดงใน dropdown 2
$value2 = "lease_id"; // ฟิวด์ ที่ให้ค่า value dropdown 2
// ค่า listbox 3 : มี $id2 จากตาราง2 เป็น (FK)
$table3 = "tb_bill_mrent";
$id3 = "Mbill_id"; // ฟิวด์ id ของตารางที่ 3 (PK)
$text3 = "Mbill_date";
$value3 = "Mbill_id";
// ค่า listbox 4 : มี $id3 จากตาราง3 เป็น (FK)
$table4 = "tb_table4";
$id4 = "id4";
$text4 = "name4";
$value4 = "id4";
// ค่า listbox 5 : มี $id4 จากตาราง4 เป็น (FK)
$table5 = "tb_table5";
$id5 = "id5";
$text5 = "name5";
$value5 = "id5";
?>
<script type="text/javascript">
var select_text1 = new Array();
var select_value1 = new Array();
var select_text2 = new Array();
var select_value2 = new Array();
var select_text3 = new Array();
var select_value3 = new Array();
var select_text4 = new Array();
var select_value4 = new Array();
var select_text5 = new Array();
var select_value5 = new Array();
</script>
<form>
<select id="id_select[1]" name="name1" onChange="return show_select_next(1,2,select_text2,select_value2)"><option value="">select1</option></select>
<select id="id_select[2]" name="name2" onChange="return show_select_next(2,3,select_text3,select_value3)"><option value="">select2</option></select>
<select id="id_select[3]" name="name3" onChange="return show_select_next(3,4,select_text4,select_value4)"><option value="">select3</option></select>
<select id="id_select[4]" name="name4" onChange="return show_select_next(4,5,select_text5,select_value5)"><option value="">select4</option></select>
<select id="id_select[5]" name="name5"><option value="">select5</option></select>
<input type="submit">
</form>
<?
$select1 = mysql_query("SELECT * FROM $table1");
for($s1=0;$s1<mysql_num_rows($select1);$s1++)
{
$arr_s1=mysql_fetch_array($select1);
?>
<script language="javascript">
select_text1[<?=$s1?>] = '<?=$arr_s1[$text1]?>';
select_value1[<?=$s1?>] = '<?=$arr_s1[$value1]?>';
select_text2['<?=$arr_s1[$value1]?>'] = new Array();
select_value2['<?=$arr_s1[$value1]?>'] = new Array();
</script>
<?
$select2 = mysql_query("SELECT * FROM $table2 where ".$id1." = '".$arr_s1[$id1]."'");
for($s2=0;$s2<mysql_num_rows($select2);$s2++)
{
$arr_s2=mysql_fetch_array($select2);
?>
<script language="javascript">
select_text2['<?=$arr_s1[$value1]?>'][<?=$s2?>] = '<?=$arr_s2[$text2]?>';
select_value2['<?=$arr_s1[$value1]?>'][<?=$s2?>] = '<?=$arr_s2[$value2]?>';
select_text3['<?=$arr_s2[$value2]?>'] = new Array();
select_value3['<?=$arr_s2[$value2]?>'] = new Array();
</script>
<?
$select3 = mysql_query("SELECT * FROM $table3 where ".$id2." = '".$arr_s2[$id2]."'");
for($s3=0;$s3<mysql_num_rows($select3);$s3++)
{
$arr_s3=mysql_fetch_array($select3);
?>
<script language="javascript">
select_text3['<?=$arr_s2[$value2]?>'][<?=$s3?>] = '<?=$arr_s3[$text3]?>';
select_value3['<?=$arr_s2[$value2]?>'][<?=$s3?>] = '<?=$arr_s3[$value3]?>';
select_text4['<?=$arr_s3[$value3]?>'] = new Array();
select_value4['<?=$arr_s3[$value3]?>'] = new Array();
</script>
<?
$select4 = mysql_query("SELECT * FROM $table4 where ".$id3." = '".$arr_s3[$id3]."'");
for($s4=0;$s4<mysql_num_rows($select4);$s4++)
{
$arr_s4=mysql_fetch_array($select4);
?>
<script language="javascript">
select_text4['<?=$arr_s3[$value3]?>'][<?=$s4?>] = '<?=$arr_s4[$text4]?>';
select_value4['<?=$arr_s3[$value3]?>'][<?=$s4?>] = '<?=$arr_s4[$value4]?>';
select_text5['<?=$arr_s4[$value4]?>'] = new Array();
select_value5['<?=$arr_s4[$value4]?>'] = new Array();
</script>
<?
$select5 = mysql_query("SELECT * FROM $table5 where ".$id4." = '".$arr_s4[$id4]."'");
for($s5=0;$s5<mysql_num_rows($select5);$s5++)
{
$arr_s5=mysql_fetch_array($select5);
?>
<script language="javascript">
select_text5['<?=$arr_s4[$value4]?>'][<?=$s5?>] = '<?=$arr_s5[$text5]?>';
select_value5['<?=$arr_s4[$value4]?>'][<?=$s5?>] = '<?=$arr_s5[$value5]?>';
</script>
<?
}
}
}
}
}
?>
<script type="text/javascript">
var options1 = (parseFloat(select_text1.length)+1);
document.getElementById('id_select[1]').length = options1;
for(var ss1 = 1; ss1 < options1; ss1++)
{
document.getElementById('id_select[1]').options[ss1].text = select_text1[ss1-1];
document.getElementById('id_select[1]').options[ss1].value = select_value1[ss1-1];
}
function show_select_next(change_select,select_next,array_next,array_next2)
{
var id_next = select_next ;
while(document.getElementById('id_select['+id_next+']'))
{
document.getElementById('id_select['+id_next+']').length=1;
document.getElementById('id_select['+id_next+']').options[0].selected =true
id_next++;
}
var name_text ;
var name_value;
var num_options = (parseFloat(array_next2[document.getElementById('id_select['+change_select+']').value].length)+1);
document.getElementById('id_select['+select_next+']').length = num_options;
for(var nn = 1; nn < num_options; nn++)
{
name_value = array_next2[document.getElementById('id_select['+change_select+']').value][nn-1];
name_text = array_next[document.getElementById('id_select['+change_select+']').value][nn-1];
document.getElementById('id_select['+select_next+']').options[nn].text = name_text;
document.getElementById('id_select['+select_next+']').options[nn].value = name_value;
}
}
</script>
|
 |
 |
 |
 |
Date :
2010-06-22 19:24:25 |
By :
heng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|