<title>Untitled Document</title> <script language = "JavaScript"> //**** List Amphur (Start) ***// function List_type(SelectValue) { form2.spechee.length = 0 //*** Insert null Default Value ***// var myOption = new Option('','') form2.spechee.options[form2.spechee.length]= myOption <? $intRows = 0; $strSQL = "SELECT * FROM tb_spechee"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { $intRows++; ?> x = <?=$intRows;?>; mySubList = new Array(); strGroup = <?=$objResult['ref_t_id'];?>; strValue = "<?=$objResult["s_id"];?>"; strItem = "<?=$objResult["s_name"];?>"; mySubList[x,0] = strItem; mySubList[x,1] = strGroup; mySubList[x,2] = strValue; if (mySubList[x,1] == SelectValue){ var myOption = new Option(mySubList[x,0], mySubList[x,2]) form2.spechee.options[form2.spechee.length]= myOption } <? } ?> } </script> <style type="text/css"> <!-- .style11 {color: #FF0000} --> </style> </head> <body> <table width="668" border="1"> <tr> <td width="294"><span class="style11"> <select id="type" name="type" onchange = "List_type(this.value)" style="width:220px"> <option>---------กรุณาเลือกประเภทสินค้า---------</option> <? $strSQL = "SELECT * FROM tb_type"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); while($objResult = mysql_fetch_array($objQuery)) { ?> <option value="<?=$objResult["t_id"];?>"> <?=$objResult["t_name"];?> </option> <? } ?> </select> </span></td> <td width="410"><span class="normal_font"> <select id="spechee" name="spechee" style="width:150px"> </select> </span></td> </tr> </table> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง