我有一个 onChange 事件,但在更改时它不会被触发。我已经验证我正确地调用了这些字段。
$("#SRIEquipmentDDL").change(function() {
if ($(this).val() == "3") {
$("#SRILift").show();
} else {
$("#SRILift").hide();
}
});
<div id="SRIEquipment">
<div class="TextField">Equipment:</div>
<div class="InputField">
<select name="SRIEquipmentDDL" id="SRIEquipmentDDL" class="DropDownField">
<option value="0" <?php if ($_POST['SRIEquipmentDDL'] == "0") {echo "selected='selected'";} ?> >Select Chair Type</option>
<option value="1" <?php if ($_POST['SRIEquipmentDDL'] == "1") {echo "selected='selected'";} ?> >Manual Wheelchair</option>
<option value="2" <?php if ($_POST['SRIEquipmentDDL'] == "2") {echo "selected='selected'";} ?>>Power Wheelchair</option>
<option value="3" <?php if ($_POST['SRIEquipmentDDL'] == "3") {echo "selected='selected'";} ?>>Lift Chair</option>
<option value="4" <?php if ($_POST['SRIEquipmentDDL'] == "4") {echo "selected='selected'";} ?>>Scooter</option>
<option value="5" <?php if ($_POST['SRIEquipmentDDL'] == "5") {echo "selected='selected'";} ?>>Lifts</option>
<option value="6" <?php if ($_POST['SRIEquipmentDDL'] == "6") {echo "selected='selected'";} ?>>CPM</option>
<option value="8" <?php if ($_POST['SRIEquipmentDDL'] == "7") {echo "selected='selected'";} ?>>Walker</option>
<option value="9" <?php if ($_POST['SRIEquipmentDDL'] == "8") {echo "selected='selected'";} ?>>Other</option>
</select>
</div>
</div>
<div id="SRILift">
<div class="TextField">Lift Type:</div>
<div class="InputField">
<select name="SRILiftTypeDDL" id="SRILiftTypeDDL" class="DropDownField">
<option value="0" <?php if ($_POST['SRILiftTypeDDL'] == "0") {echo "selected='selected'";} ?> >Select Lift Type</option>
<option value="1" <?php if ($_POST['SRILiftTypeDDL'] == "1") {echo "selected='selected'";} ?> >Stair Lift</option>
<option value="2" <?php if ($_POST['SRILiftTypeDDL'] == "2") {echo "selected='selected'";} ?>>Porch Lift</option>
<option value="3" <?php if ($_POST['SRILiftTypeDDL'] == "3") {echo "selected='selected'";} ?>>Outside Vehicle Lift</option>
<option value="4" <?php if ($_POST['SRILiftTypeDDL'] == "4") {echo "selected='selected'";} ?>>Inside Vehicle Lift</option>
<option value="5" <?php if ($_POST['SRILiftTypeDDL'] == "5") {echo "selected='selected'";} ?>>Ceiling Lift</option>
<option value="6" <?php if ($_POST['SRILiftTypeDDL'] == "6") {echo "selected='selected'";} ?>>Other</option>
</select>
</div>
</div>