ここで答えを使用します。次のように、テキスト フィールド CallType の入力に基づいて、フォーム要素のケース スイッチを別のフォーム要素に設定します。
<select id="CallType" name="CallType">
<option value="1">1</option>
<option value="2">2</option>
</select>
次に、このようにケース スイッチを設定しますが、フォームの投稿時に値がデータベースに挿入されません。静的な CallDesc テキスト フィールドを使用してこれをテストすると、フォームが正常に挿入されます。私は何を間違っていますか?
サンプル スイッチ:
<?php
switch($_POST['CallType']) {
case '1':
echo '<input id="CallDesc" name="CallDesc" type="text" value="Air-conditioner / Heat Pumps" class="formTextfield_Medium" tabindex="3">';
break;
case '2':
echo '<input id="CallDesc" name="CallDesc" type="text" value="Refrigerator / Ice (Makers/Machines) / Wine Cooler" class="formTextfield_Medium" tabindex="3">';
break;
}
?>