florida
07-06-2004, 06:23 PM
I am trying to get my radio buttons to have two choices where each one takes me to a different action page. It keeps giving me the error:
document.queryForm.myAction2 is null or not an object
Here is my attempt:
<SCRIPT language="JavaScript">
function do_submit()
{
if (document.queryform.myAction2[0].checked)
{
document.queryform.action = 'PageOne.cfm';
//document.queryform.submit(); it bombs with or without this line uncommented
}
else if (document.queryform.myAction2[1].checked)
{
document.queryform.action = 'PageTwo.cfm';
// document.queryform.submit(); it bombs with or without this line uncommented
}
}
</SCRIPT>
The calling area and radio buttons:
<FORM METHOD="post" NAME="queryForm" onsubmit="do_submit();">
....
<input type="radio" name="myAction2" checked> first action<br>
<input type="radio" name="myAction2"> second action
Please advise.
document.queryForm.myAction2 is null or not an object
Here is my attempt:
<SCRIPT language="JavaScript">
function do_submit()
{
if (document.queryform.myAction2[0].checked)
{
document.queryform.action = 'PageOne.cfm';
//document.queryform.submit(); it bombs with or without this line uncommented
}
else if (document.queryform.myAction2[1].checked)
{
document.queryform.action = 'PageTwo.cfm';
// document.queryform.submit(); it bombs with or without this line uncommented
}
}
</SCRIPT>
The calling area and radio buttons:
<FORM METHOD="post" NAME="queryForm" onsubmit="do_submit();">
....
<input type="radio" name="myAction2" checked> first action<br>
<input type="radio" name="myAction2"> second action
Please advise.