<input type="submit" name="button" class="button" value="บันทึก" onClick="return rechk();" />
<html> <head> <title>ThaiCreate.Com Tutorial</title> </head> <body> <script language="javascript"> function fncSubmit(strPage) { if(document.form1.txtName.value == "a") { document.form1.action="page1.cgi"; } else { document.form1.action="page2.cgi"; } document.form1.submit(); } </script> <form action="page.cgi" method="post" name="form1"> <input name="txtName" type="text" id="txtName"> <input name="btnButton" type="button" value="Button" onClick="JavaScript:fncSubmit();"> </form> </body> </html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <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 } <? } ?> } </script> </head> <body> <form name="regis" method="post"> <table width="100%" align="center"> <tr> <td align="right">ประเภทโปรโมชั่น :</td> <td align="left"> <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> </td> <td><span id="msg_unitid" class="text7"></span></td> </tr> <tr> <td align="right">ชื่อโปรโมชั่น :</td> <td align="left"> <select name="proid" id="proid" onBlur="chkpro();" style="width:100px"></select> </td> <td><span id="msg_pro" class="text7"></span></td> </tr> <tr> <td align="right"> </td> <td align="left"> <input type="submit" name="button" class="button" value="บันทึก" onClick="return rechk();" /> <input type="button" name="button2" id="button2" class="button" value="ยกเลิก" onClick="window.location='user_page.php?option=addcus'" /> </td> </tr> </table> </form> </body> </html>
function rechk(){ var check1=chkpassword(); var check2=chkpasswordConfirm(); var check3=chkmailaddr(); var check4=chktitle(); var check5=chkfirstname(); var check6=chklastname(); var check7=chkidcard(); var check8=chkhousenum(); var check9=chkmoo(); var check10=chkroad(); var check11=chksoi(); var check12=chkdistrict(); var check13=chkamphur(); var check14=chkprovince(); var check15=chkzipcode(); var check16=chktel(); var check17=chkunit_id(); var check18=chkpro(); if(check1==0 && check2==0 && check3==0 && check4==0 && check5==0 && check6==0 && check7==0 && check8==0 && check9==0 && check10==0 && check11==0 && check12==0 && check13==0 && check14==0 && check15==0 && check16==0 && check17==0 && check18==0){ return true } //return false //test target if(document.regis.unit_id.value == "1") { document.regis.action="savecus_hour.php"; } else if(document.regis.unit_id.value == "2") { document.regis.action="savecus_day.php"; } else { document.regis.action="savecus_month.php"; } return false // document.regis.submit(); } </script>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง