1 番目のドロップダウン リストが選択された後、2 番目、3 番目、...、7 番目のドロップダウン リスト (すべて同じエントリ) を入力できる例が必要です。HTMLヘッドの前に、すべての値をPHPの配列に格納しています。
いくつかの例を見てきましたが、特定の解決策を見つけることができませんでした
例: 前述のフランチャイジーの下にフランチャイジーとアウトレットでいっぱいの倉庫があるとします。n 個のアウトレットを持つ特定のフランチャイジーの 7 日前の注文リストを作成する必要があります。私の解決策は、ユーザー/倉庫のオペレーターがフランチャイズ加盟店を選び、2 番目 (7 番目まで) のドロップダウン リストに、その選ばれたフランチャイズ加盟店の下にあるアウトレットが表示されるというものでした。
ありがとう。
<?php
$productClass = new product();
$productClass->setProductList();
$franchiseeClass = new users();
$franchiseeClass->getAndSetAllFranchisees();
$franchiseeArray = $franchiseeClass->getUserList();
$operatorOutletClass = new users();
$operatorOutletClass->getAndSetUserByLevel("5");
?>
<html><head></head><body>
<div align="center">
<form name="BBOFranchisee" method="post" action="?" onSubmit="return checkSubmit()">
<table align="center" border="1">
<tr>
<td>
Franchisee:
</td>
<td colspan="8">
<select name="displayFranchisee" size="1" onChange="populateOutlet('findOutletByFranchisee.php?fid='+this.value)">
<option label="franchisees" value="0">--Choose Franchisee--</option>
<?php
for($i=0;$i<count($franchiseeArray);$i++)
{
foreach($franchiseeArray[$i] as $key => $val)
{
echo "<option label=\"franchisees\" value=\"$key\">$val</option>\n";
}
} ?>
</select>
</td>
</tr>
<tr>
<?php for($j=0;$j<7;$j++) { ?>
<td>
Outlet:
<select name="displayOutlet<?php echo $j; ?>" size="1">
<option label="outlets" value="0"> </option>
</select>
</td>
<?php } ?>
</tr>
</body>
</html>
継続はJavaScriptの部分だと思います.. http://roshanbh.com.np/2007/12/change-dropdown-list-options-values-from-database-with-ajax- and-php.htmlは提供しますが、複数のドロップダウンでは機能しません。