|
 |
|
สอบถามเรื่องการทำ Combobox หน่อยค่ะ... คือตอนนี้ติดปัญหาตรงว่า พอกดเลือกสาขาอยากให้ไปเลือกคลังตามที่มีในฐานข้อมูล |
|
 |
|
|
 |
 |
|
Code (PHP)
<? include "Connections/connect_sqlserver.php";
include "Connections/new_connect.php";
?>
<html >
<!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" src="ajax/ajax_framework.js"></script>
<script type="text/javascript" src="ajax/function.js"></script>
<link rel="stylesheet" type="text/css" href="script/epoch_styles.css">
<script type="text/javascript" src="script/epoch_classes.js"></script>
<script type="text/javascript">
</script>
<title>ทดสอบค้นหา</title>
</head>
<body>
<!--ปุ่มค้นหา-->
<form action="" method="post" name="frmTest" id="frmTest">
ค้นหา
<select required name="Group1" id="Group1" title="กรุณาเลือกสาขา">
<option value="">เลือกสาขา</option>
<?php
$sql = "SELECT * FROM dbo.BGroup
ORDER BY dbo.BGroup.Name";
$result = odbc_exec($cid,$sql);
$a=odbc_num_rows($result);
if ($a!=0) {
while($row = odbc_fetch_array($result))
{
$Name =iconv('tis620','utf-8',$row['Name']);?>
<option value='<?=iconv('tis620','utf-8',$row['ID']);;?>'><?=$Name;?></option>"."<BR>";
<? }}?>
</select>
<select required name="Branch1" id="Branch1" title="กรุณาเลือกคลัง">
<option value="">เลือกคลัง</option>
<?php
$sql2 = "SELECT * FROM dbo.Branch
ORDER BY dbo.Branch.Name";
$result2 = odbc_exec($cid,$sql2);
$a=odbc_num_rows($result2);
if ($a!=0) {
while($row = odbc_fetch_array($result2))
{
$Name =iconv('tis620','utf-8',$row['Name']);?>
<option value='<?=iconv('tis620','utf-8',$row['ID']);;?>'><?=$Name;?></option>"."<BR>";
<? }}?>
</select>
จากวันที่::
<input name="D1" id="D1"type="text" size="7" onClick="DateShow()"> -
<input name="D2" id="D2"type="text" size="7">
<input name="" type="button" value="ค้นหา" onClick="fnc_SearchSell();">
</form>
</body>
</html>
สอบถามเรื่องการทำ Combobox หน่อยค่ะ
คือตอนนี้ติดปัญหาตรงว่า พอกดเลือกสาขาอยากให้ไปเลือกคลังตามที่มีในฐานข้อมูล
เช่น...
สาขา A มีคลัง 1,2
สาขา B มีคลัง 3,4,5
พอกดเลือกสาขา A ก็จะโชว์ คลัง 1 กับ 2 ขึ้นมาเท่านั้นค่ะ
Tag : PHP, MySQL, Ajax

|
|
 |
 |
 |
 |
Date :
2014-05-02 12:37:45 |
By :
NC |
View :
814 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ
|
 |
 |
 |
 |
Date :
2014-05-02 13:09:45 |
By :
NC |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|