|
 |
|
ขอตัวอย่าง select box เวลา onchangeเลือกค่าแล้วไม่ให้รีเฟรชหน้าแล้วไปคิวรีค่ามาโชว์ในตารางแทน textbox ทีครับ |
|
 |
|
|
 |
 |
|
ajax ครับ ในนี้มีตัวอย่าง ค้นหาดูครับ
|
 |
 |
 |
 |
Date :
2014-08-21 21:03:22 |
By :
mangkunzo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (JavaScript)
<!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" />
<title>TEST</title>
<link href="http://171.100.66.111/jq/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
<script src="http://171.100.66.111/jq/jquery-1.8.2.js"></script>
<script src="http://171.100.66.111/jq/ui/jquery-ui.js"></script>
<head>
<script>
$(document).ready(function(){
$('#slc').on("change",'','', function(){
var yourvalue=$(this).val();
$.ajax({ url: 'yourfile.php', type: 'GET', data: {yourparam: yourvalue}}).done(function(msg){ $('.report').html( msg ).slideDown(500);});
});
$('#closePage').on('click', '', '', function(){ $('.report').slideToggle(); });
});
</script>
</head>
<body>
<div class="main">
<div class="page"><select id="slc">
<option value="กรุณาเลือกหน้า">กรุณาเลือกหน้า</option>
<option value="1">หน้า 1</option>
</select>
</div>
<div class="report" style="display:none">
<table><tr><td>
<div class="data" >เนื้อหาหน้าที่ เปลี่ยนตาม select</div>
<center><button type="button" id="closePage">X</button></center>
</td></tr></table>
</div>
</div>
</body>
</html>
|
 |
 |
 |
 |
Date :
2014-08-22 09:56:31 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|