Need to only pass url for radio button selected on form

Hello, I have the following script:

<script type=“text/javascript”>

function OnSubmitForm()

{

if(document.myform.operation[0].checked == true)

{

document.myform.action ="https://webtrace.etdatacenter.com/webtrace.aspx?accesstype=autologin&cust=id_015&user=lhowe";  

}

else

if(document.myform.operation[1].checked == true)

{

document.myform.action ="https://carrierconnect.etdatacenter.com/Default.aspx?accesstype=autologin&cust=id_015&user=lhowe";  

}

return true;

}

</script>

<form name=“myform” target=“_blank” action=“” onsubmit=“return OnSubmitForm();”>
<fieldset>
<legend><font color=“#FFFFFF”>LOGIN</font></legend>
username: <input type=“text” name=“username”/><br />
password: <input type=“password” name=“password”/><br />
<input type=“radio” name=“operation” value=“1” checked><font size=“-1”>Customer Tracking</font>
<input type=“radio” name=“operation” value=“2”><font size=“-1”>Web Booking </font>

<input type=“submit” name=“submit” value=“submit”>
</fieldset>

</form>

Where the value of OnSubmitForm() is chosen and I want the user to be directed to either the first url in the function or the second based on which radio button chosen, but only read in the url and not any of the selections made, i.e. don’t pass through the user, password, radio button selected

If anyone could tell me what needs to be adjusted on the form I would really apppreciate it.

thanks

It sounds like all you want to do is send the user to a different page. If that’s the case, you don’t have to mess with the form’s action. You can just change the window’s location:


function OnSubmitForm() {
    if(document.myform.operation[0].checked == true) {
        window.location ="https://webtrace.etdatacenter.com/webtrace.aspx?accesstype=autologin&cust=id_015&user=lhowe";
    } else if(document.myform.operation[1].checked == true) {
        window.location ="https://carrierconnect.etdatacenter.com/Default.aspx?accesstype=autologin&cust=id_015&user=lhowe";
    }
    return true;
}