Is this correct? I want to have a selection of action to the form. I have a drop down where each option will send to a different page. But there seem to be bugs in the javascript.

Code:
function checkAll(form,cbox)
{
var ct;
if(cbox.checked == true)ct = true;
else if(cbox.checked == false)ct = false;
for(var i = 0; i < form.length; i++)
{
if(form[i].type=='checkbox')form[i].checked = ct;
}
}
function SetAction()
{
do some validation...
if (this is where your number checking validation goes)
{
return false //this will cancel submit
}
else
{
if (you want to go here)
{
document.form1.action = 'set to URL you want to go to';
document.form1.submit();
}
else
{
document.form1.action = 'set to other URL you want to go to';
document.form1.submit();
}
}
}
</SCRIPT>

...
<form align="center" method="get" 
onsubmit="java script: return SetAction();" 
action="<%=SCRIPT_SAVED%>" id=form1 name=form1>Select</font><br>
<select size="1" name="choices" id="choices">
<option SELECTED VALUE="">None</option> 
<option VALUE="001">Delete</option>
<option VALUE="002">Email to:</option>
<option VALUE="003">Print</option>
<option VALUE="004">Save in:</option>
</select><input type="submit" value="OK" name=submit1><br>
<input type='checkbox' onclick='javascript: checkAll(this.form.this);' value="check all" name="ck<%CStr(id)%>">
<font face="Verdana" color="#FFFFFF">Select All</font></th>
...
<p><input type="checkbox" name="ck<%CStr(id)%>" value="<%=rs("id")%>"></p>
The CheckAll worked before inserting the second javascript. But when I inserted it it stopped working (checking all checkboxes)