guitarlass
08-23-2010, 04:17 AM
Hello,
i wrote this code, But is not working, i want to use onChange event and redirect user into a url accordingly. this is my code;
<script type="text/javascript">
function goto()
{
var URL = document.frmsort.optsort.options[document.optsort.optsort.selectedIndex].value;
window.location.href = URL;
}
</script>
<form id="frmsort" name="frmsort" action="http://localhost/APP/category.php" method="post">
<select name="urls" onChange="goto()">
<option value="http://localhost/APP/category.php?sub=1">-- choose option --</option>
<option value="http://localhost/APP/category.php?sub=1&sort=1">OP1</option>
<option value="http://localhost/APP/category.php?sub=1&sort=2">OP2</option>
</select> </form>
I really appreciate your help...
thank you...
i wrote this code, But is not working, i want to use onChange event and redirect user into a url accordingly. this is my code;
<script type="text/javascript">
function goto()
{
var URL = document.frmsort.optsort.options[document.optsort.optsort.selectedIndex].value;
window.location.href = URL;
}
</script>
<form id="frmsort" name="frmsort" action="http://localhost/APP/category.php" method="post">
<select name="urls" onChange="goto()">
<option value="http://localhost/APP/category.php?sub=1">-- choose option --</option>
<option value="http://localhost/APP/category.php?sub=1&sort=1">OP1</option>
<option value="http://localhost/APP/category.php?sub=1&sort=2">OP2</option>
</select> </form>
I really appreciate your help...
thank you...