<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> <!-- function onaction(){ if( document.getElementById('listac').value=="type"){ document.getElementById('typediv').style.display=""; document.getElementById('serialdiv').style.display="none"; document.getElementById('divisiondiv').style.display="none"; document.getElementById('namediv').style.display="none"; return false }else if(document.getElementById('listac').value=="serial"){ document.getElementById('typediv').style.display="none"; document.getElementById('serialdiv').style.display=""; document.getElementById('divisiondiv').style.display="none"; document.getElementById('namediv').style.display="none"; return false }else if(document.getElementById('listac').value=="division"){ document.getElementById('typediv').style.display="none"; document.getElementById('serialdiv').style.display="none"; document.getElementById('divisiondiv').style.display=""; document.getElementById('namediv').style.display="none"; return false }else if(document.getElementById('listac').value=="name"){ document.getElementById('typediv').style.display="none"; document.getElementById('serialdiv').style.display="none"; document.getElementById('divisiondiv').style.display="none"; document.getElementById('namediv').style.display=""; return false /* }else{ document.getElementById('typediv').style.display="none"; document.getElementById('serialdiv').style.display="none"; document.getElementById('divisiondiv').style.display="none"; document.getElementById('namediv').style.display="none"; return false */ } } </script> </head> <body> <select onchange="return onaction()" name="listac" id="listac"> <option value="" <? if($_GET["listac"]==""){echo "selected='selected'";}?>>--เลือกวิธีการค้นหา--</option> <option value="type" <? if($_GET["listac"]=="type"){echo "selected='selected'";}?>>ประเภท</option> <option value="serial" <? if($_GET["listac"]=="serial"){echo "selected='selected'";}?>>รหัส Serial ID</option> <option value="division" <? if($_GET["listac"]=="division"){echo "selected='selected'";}?>>หน่วยงาน</option> <option value="name" <? if($_GET["listac"]=="name"){echo "selected='selected'";}?>>ชื่อครุภัณฑ์</option> </select> <div id="typediv" style="<? if($a==""){echo "display:none";}else{ echo "";}?>;"> <option value="" >--- เลือกประเภท ---</option> <option value="db_computerset">คอมพิวเตอร์และอุปกรณ์</option> <option value="db_notebook">Notebook</option> <option value="db_monitor">Monitor</option> <option value="db_printer">Printer</option> <option value="db_ups">Ups</option> <option value="db_projector">Projector</option> <option value="db_camera">Camera</option> </select> </p> <p> <input type="submit" value="Submit" onclick="<?php $_GET["listac"]=="type" ?>"/> </p> </form> // ********************** พอกดปุ่มเพื่อค้นหา ข้อมูลมันจะถูกค้น แต่โดนซ่อนไว้ค่ะ ************************** </div> <div id="serialdiv" style="display : none;"> <!-- ------------- ฟอร์มที่ 2 ค้นหาตามเลข serial number--- --> ค้นหาจากหมายเลข SERIAL NUMBER <br/><br/> <form id="form2" name="form" method="get" action="<?search.php?>"> <p> ใส่รหัส Serial Number <input type = "text" name="serial" id="serial" /> </p> <p> <input type="submit" value="Submit Serial" /> <!-- <input type="submit" name="submit_serial" id="submit_serial" value="Submit Serial" /> --> </p> </form> <?php if ($_GET["serial"]) { $serial = $_GET["serial"]; echo "$serial<br/>"; ?> </div> </body> </html>
Quote:style="display : none;"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>php พอกดปุ่มแล้วทำไมค่าไฟล์มันถูกซ่อนไว้คะ วานช่วยด้วยนะคะ หลายวันแล้ว TT</title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <script src="http://code.jquery.com/jquery-latest.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf8" /> <style type="text/css"> #texttitle{ display:block; width:400px; padding:5px; } .hide{ display:none; } ul li { display:inline-block; width:120px; list-style:none; } </style> </head> <body> <select id="category"> <option value="department" rel="ค้นหาจากหน่วยงานที่ติดตั้งอุปกรณ์">หน่วยงาน</option> <option value="item" rel="ค้นหาจากอุปกรณ์ที่ทำการยืม">ครุภัณฑ์</option> </select> <div id="texttitle"></div> <div class="hide" id="department_section"> <ul> <li>เลือกหน่วยงาน</li> <li> <select id="depSearch"> <option value="medic">องค์กรแพทย์</option> <option value="engineer">หน่วยซ่อมบำรุง</option> </select> </li> <li><input type="button" id="doDepSearch" value="ค้นหาหน่วยงาน" /></li> </ul> </div> <div class="hide" id="item_section"> <ul> <li>เลือกครุภัณฑ์</li> <li> <select id="itemSearch"> <option value="ups">เครื่องสำรองไฟ</option> <option value="laptop">โน๊ตบุ๊ค</option> </select> </li> <li><input type="button" id="doItemSearch" value="ค้นหาครุภัณฑ์" /></li> </ul> </div> <script> $("#category").change(function(){ var choice = $(this,":selected").val(); var titles = $("option:selected",this).attr("rel"); $("div#texttitle").empty().append(titles); $("div.hide").hide(); $("div#"+choice+"_section").slideDown(500); }); </script> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง