我尝试根据用户在下拉菜单中选择“标准”还是“维护”来重定向页面。Hoewever 我的 javascript 不能正常工作。你能帮我指出我哪里出错了吗?
提前致谢。
<script type="text/javascript">
<!--
function formType(value){
if (value == 'maintenance') {
window.location = "index.php?requestType=maintenance";
} else {
window.location = "index.php?requestType=standard";
}
-->
</script>
<select id="changer" name="type" onchange="formType(this.value);">
<option value="standard" <?php if ($requestType == 'standard') { echo "selected"; } ?>>Standard</option>
<option value="maintenance" <?php if ($requestType == 'maintenance') { echo "selected"; } ?>>Maintenance</option>
</select>