需要在下拉列表中捕获发布的值
need to catch posted value back in dropdown
<select name="ui3" oninput="load_ui('#ui3')" id="ui3" class="form-control" value="<?php echo isset($_POST["ui3"]) ? $_POST["ui3"] : ''; ?>">
<option value="IEC 60137: 2017">IEC 60137: 2017</option>
<option value="ANSI / IEEE C57.19.00/01">ANSI / IEEE C57.19.00/01</option>
<option value="other">Others</option>
</select>
您需要检查 post
值是否等于 dropdown
选项,如下所示:
<select name="ui3" oninput="load_ui('#ui3')" id="ui3" class="form-control">
<option value="IEC 60137: 2017" <?= isset($_POST["ui3"]) && $_POST["ui3"] == 'IEC 60137: 2017' ? 'selected' : ''; ?>>IEC 60137: 2017</option>
<option value="ANSI / IEEE C57.19.00/01" <?= isset($_POST["ui3"]) && $_POST["ui3"] == 'ANSI / IEEE C57.19.00/01' ? 'selected' : ''; ?>>ANSI / IEEE C57.19.00/01</option>
<option value="other" <?= isset($_POST["ui3"]) && $_POST["ui3"] == 'other' ? 'selected' : ''; ?>>Others</option>
</select>
<select name="ui3" oninput="load_ui('#ui3')" id="ui3" class="form-control" value="<?php echo isset($_POST["ui3"]) ? $_POST["ui3"] : ''; ?>">
<option value="IEC 60137: 2017">IEC 60137: 2017</option>
<option value="ANSI / IEEE C57.19.00/01">ANSI / IEEE C57.19.00/01</option>
<option value="other">Others</option>
</select>
您需要检查 post
值是否等于 dropdown
选项,如下所示:
<select name="ui3" oninput="load_ui('#ui3')" id="ui3" class="form-control">
<option value="IEC 60137: 2017" <?= isset($_POST["ui3"]) && $_POST["ui3"] == 'IEC 60137: 2017' ? 'selected' : ''; ?>>IEC 60137: 2017</option>
<option value="ANSI / IEEE C57.19.00/01" <?= isset($_POST["ui3"]) && $_POST["ui3"] == 'ANSI / IEEE C57.19.00/01' ? 'selected' : ''; ?>>ANSI / IEEE C57.19.00/01</option>
<option value="other" <?= isset($_POST["ui3"]) && $_POST["ui3"] == 'other' ? 'selected' : ''; ?>>Others</option>
</select>