I am try to redirect the page depending on whether the users selects ‘standard’ or ‘maintenance’ in a drop down menu. Hoewever my javascript isn’t quite working. Can you help point me where I’m going wrong?
Thanks in advance.
<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>
You are missing a
}at the end of your function.