<script type="text/javascript"> function notEmpty(){ var ckk = document.getElementById('chk[]'); if (!ckk.checked) { alert("You forget to select or enter the server !"); } </script> <div class="container"> <table width="320" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <th width="130">Server Name</th> <th width="130">OS</th> <th width="130">Location</th> </tr> <?php $db_host = 'localhost'; $db_user = 'root'; $db_pwd = ''; $db = 'opacv2'; // connect to mysql server $connect = mysql_connect($db_host, $db_user, $db_pwd); if (!$connect) { die("Failed to connect to mysql server."); $select = mysql_select_db($db); } $strSQL = "SELECT server, location, OS FROM opacv2.test_cmdb"; $objQuery = mysql_query($strSQL); while($objResuut = mysql_fetch_array($objQuery)) { ?> <tr> <td><input type="checkbox" name="chk[]" id="chk[]"></td> <td><?php echo $objResuut["server"]; ?></td> <td><?php echo $objResuut["OS"]; ?></td> <td><?php echo $objResuut["location"]; ?></td> </tr> <?php } ?> </table> </div> <input type='button' onclick='notEmpty(this)' value='Submit' />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script> function notEmpty(){ if($('input[name="chk[]"]:checked').length == 0){ alert('You forget to select or enter the server !'); } else if (เช็คเงือนไขตรง textarea ว่าค่าห้ามตรงกับ chk[] ขางบน) alert('ข้อมูลที่คุณกรอก มีอยู่ในฐานข้อมูลแล้ว'); }else if (chk[] ข้างบน กับ radio button ต้องเลือกอย่างใด้อย่างหนึ่ง ห้ามว่าง หรือจะเลือกทั้ง chk[] กับ radio button ก็ได้) { alert('คุณต้องเลือก ข้อมูลใน chk[] หรือ radio button อย่างใดอย่างหนึ่งหรือ สองอย่าง ห้ามว่าง'); } else if (เช็คเงือนไขว่า chk[] ข้อมูลที่คุณเลือก ห้ามซำ้กัน) { alert('ข้อมูลใน chk[] ที่คุณเลือกมันซ้ำกัน คุณต้อง unlick หนึ่งอันออก'); } } </script> <div class="container"> <table width="320" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <th width="130">Server Name</th> <th width="130">OS</th> <th width="130">Location</th> </tr> <?php $db_host = 'localhost'; $db_user = 'root'; $db_pwd = ''; $db = 'opacv2'; // connect to mysql server $connect = mysql_connect($db_host, $db_user, $db_pwd); if (!$connect) { die("Failed to connect to mysql server."); $select = mysql_select_db($db); } $strSQL = "SELECT server, location, OS FROM opacv2.test_cmdb"; $objQuery = mysql_query($strSQL); while($objResuut = mysql_fetch_array($objQuery)) { ?> <tr> <td><input type="checkbox" name="chk[]" id="chk[]"></td> <td><?php echo $objResuut["server"]; ?></td> <td><?php echo $objResuut["OS"]; ?></td> <td><?php echo $objResuut["location"]; ?></td> </tr> <?php } ?> </table> </div> <br> If the server is not in above list, please enter server name here:<br><b>Insert/Paste Server List (One column, One Server per line.)<br> <textarea id="txServer" rows="10" cols="40"></textarea><br><h3> <br> <input type="radio" name="choice" id="count_5" value="1. pstats - Jun 30 2010 16:55:07">pstats - Jun 30 2010 16:55:07<br> <input type="radio" name="choice" id="count_6" value="2. pstats - Jan 26 2012 12:43:26">pstats - Jan 26 2012 12:43:26<br> <input type="radio" name="choice" id="count_7" value="3. pstats - Oct 15 2013 15:04:37">pstats - Oct 15 2013 15:04:37<br> <input type='button' onclick='notEmpty(this)' value='Submit' /></h3>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง