dpodkuik@gmail.com wrote:[color=blue]
> I have simplified the function based on your advice[/color]
But you still prefer to use "lazy syntacs" instead of the proper one:
document.forms[...].elements[...]
OK, it's your code - but don't say you weren't alerted.
[color=blue]
> but still was only
> able to obtain result in Firefox with onclick set instead of onchange.[/color]
"onclick" is not promised to work with select elements. Select elements
do support guaranteed onfocus - onchange - onblur handlers.
[color=blue]
> When I use onchage nothing works anywhere.[/color]
Which means that you have some other error somewhere. Compare this
testcase with your page to find out where:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script>
function sortStaff(action)
{
document.statusForm.action="status.cfm?sortBy="+ac tion;
alert(document.statusForm.action);
}
</script>
</head>
<body bgcolor="#FFFFFF">
<form method="post" action="" name="statusForm">
<select name="select1"
onchange="sortStaff(this[this.selectedIndex].value)">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</body>
</html>