<form name="frmMain" action="" method="post"> ปี <select id="pyear" name="pyear" onChange = "ListName(this.value)"> <option selected value=""></option> <? $strSQL = "SELECT * FROM period_mem ORDER BY pid ASC "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); while($objResult = mysql_fetch_array($objQuery)) { ?> <option value="<?=$objResult["pid"];?>"><?=$objResult["pyear"];?></option> <? } ?> </select> เดือน <select id="ddlName" name="ddlName" style="width:120px" ></select> </form>
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <? include("../include/class.mysqldb.php"); include("../include/config.inc.php"); ?> <script type="text/javascript"> //**** List promotion (Start) ***// function ListUnit(SelectValue) { regis.proid.length = 0 //*** Insert null Default Value ***// var myOption = new Option('','') regis.proid.options[regis.proid.length]= myOption <? $intRows = 0; $strSQL = "SELECT * FROM promotion where pro_status='1' ORDER BY pro_id ASC "; $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["unit_id"];?>; strValue = "<?=$objResult["pro_id"];?>"; strItem = "<?=$objResult["pro_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]) regis.proid.options[regis.proid.length]= myOption //regis.zipcode.value= strGroup; } <? } ?> } </script> </head> <body> <form action="save_cus.php" method="post" name="regis" > <table> <tr> <td align="right">ประเภทโปรโมชั่น :</td> <td align="left"><label> <select id="unit_id" name="unit_id" style="width:100px" onChange = "ListUnit(this.value)" onBlur="chkunit_id();"> <option selected value="">- กรุณาเลือก -</option> <? $strSQL = "SELECT * FROM unit ORDER BY unit_id ASC "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); while($objResult = mysql_fetch_array($objQuery)) { $unit_id=$objResult["unit_id"]; $unit_name=$objResult["unit_name"]; echo "<option value=\"$unit_id\""; if($objResult["unit_id"]==$row_show["unit_id"]){ echo "selected"; } echo ">$unit_name</option>"; } ?> </select> </label></td> <td><span id="msg_unitid" class="text7"></span></td> </tr> <tr> <td align="right">ชื่อโปรโมชั่น :</td> <td align="left"><label> <select name="proid" id="proid" onBlur="chkpro();" style="width:100px"></select> </label></td> <td><span id="msg_pro" class="text7"></span></td> </tr> </table> </form> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง