<html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <body> <script type="text/javascript"> function AjaxFunction(secId) { var xmlhttp; try { // Firefox, Opera 8.0+, Safari xmlhttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } function stateck() { if(xmlhttp.readyState==2) { var myarray=eval(xmlhttp.responseText); // Before adding new we must remove previously loaded elements for(j=document.form.subsection.options.length-1;j>=0;j--) { document.form.subsection.remove(j); } for (i=0;i<myarray.length;i++) { var optn = document.createElement("OPTION"); optn.text = myarray[i]; optn.value = myarray[i]; document.form.subsection.options.add(optn); } } } var url="dd.php"; url=url+"?secId="+secId; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=stateck; xmlhttp.open("GET",url,true); xmlhttp.send(null); } </script> <form name="form" method='POST' action='index.php'> หน่วยงาน <select name=section id=section onChange="AjaxFunction(this.value);"> <option value=''><--กรุณาเลือก--></option> <? include ("db.php"); // connection to database $q=mysql_query("select * from section"); while($n=mysql_fetch_array($q)) { echo "<option value=$n[secId]>$n[secName]</option>"; } ?> </select> <select name=subsection> </select><input type=submit value=submit id=submit> </form> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง