Following is a page I've been working on. I'm trying to make the credit card validation part have radio buttons when selecting the credit card type. When I try changing them I'm loosing the functionality of the rest of my validations. Also I'm having problems changing my check button into a submit button that will direct to another page while still performing the validations. I've been successful in creating a plain submit button but not while keeping the validation part. Here is the code, Thanks in advance to anyone who can help!!:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function payments() {
//establishing variables to calculate payments to update result fields
var amount = document.mcalc.amount.value;
var rate = document.mcalc.rate.value / 1200;
var length = document.mcalc.length.value * 12;
var total = 1;
for (i=0;i<length;i++) {
total = total * (1 + rate);
}
mp = amount * rate / ( 1 - (1/total));
//results shown to hundredths
document.mcalc.payment.value = Math.round(mp * 100)/100;
document.mcalc.total.value = Math.round(mp * length * 100)/100;
}
</SCRIPT><!---End--->
<!---Credit Card Validation Process--->
<SCRIPT LANGUAGE="JavaScript">
var Cards = new makeArray(3);
Cards[0] = new CardType("MasterCard", "51,52,53,54,55", "16");
var MasterCard = Cards[0];
Cards[1] = new CardType("VisaCard", "4", "13,16");
var VisaCard = Cards[1];
Cards[2] = new CardType("AmExCard", "34,37", "15");
var AmExCard = Cards[2];
Cards[3] = new CardType("DiscoverCard", "6011", "16");
var DiscoverCard = Cards[3];
var LuhnCheckSum = Cards[4] = new CardType();


function CheckCardNumber(form) {
var tmpyear;
if (form.CardNumber.value.length == 0) {
alert("Please enter a Card Number.");
form.CardNumber.focus();
return;
}
if (form.ExpYear.value.length == 0) {
alert("Please enter the Expiration Year.");
form.ExpYear.focus();
return;
}
if (form.ExpYear.value > 1899)
tmpyear = form.ExpYear.value;
else if (form.ExpYear.value < 2021)
tmpyear = form.ExpYear.value;
else {
alert("The Expiration Year is not valid.");
return;
}
tmpmonth = form.ExpMon.options[form.ExpMon.selectedIndex].value;
// The following line doesn't work in IE3, you need to change it
// to something like "(new CardType())...".
// if (!CardType().isExpiryDate(tmpyear, tmpmonth)) {
if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) {
alert("This card has already expired.");
return;
}
card = form.CardType.options[form.CardType.selectedIndex].value;
var retval = eval(card + ".checkCardNumber(\"" + form.CardNumber.value +
"\", " + tmpyear + ", " + tmpmonth + ");");
cardname = "";
if (retval)

alert("This card number appears to be valid.");
else {

for (var n = 0; n < Cards.size; n++) {
if (Cards[n].checkCardNumber(form.CardNumber.value, tmpyear, tmpmonth)) {
cardname = Cards[n].getCardType();
break;
}
}
if (cardname.length > 0) {
alert("This looks like a " + cardname + " number, not a " + card + " number.");
}
else {
alert("This card number is not valid.");
}
}
}

Object CardType([String cardtype, String rules, String len, int year,
int month])
cardtype : type of card, eg: MasterCard, Visa, etc.
rules : rules of the cardnumber, eg: "4", "6011", "34,37".
len : valid length of cardnumber, eg: "16,19", "13,16".
year : year of expiry date.
month : month of expiry date.
eg:
var VisaCard = new CardType("Visa", "4", "16");
var AmExCard = new CardType("AmEx", "34,37", "15");

function CardType() {
var n;
var argv = CardType.arguments;
var argc = CardType.arguments.length;

this.objname = "object CardType";

var tmpcardtype = (argc > 0) ? argv[0] : "CardObject";
var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9";
var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19";

this.setCardNumber = setCardNumber; // set CardNumber method.
this.setCardType = setCardType; // setCardType method.
this.setLen = setLen; // setLen method.
this.setRules = setRules; // setRules method.
this.setExpiryDate = setExpiryDate; // setExpiryDate method.

this.setCardType(tmpcardtype);
this.setLen(tmplen);
this.setRules(tmprules);
if (argc > 4)
this.setExpiryDate(argv[3], argv[4]);

this.checkCardNumber = checkCardNumber; // checkCardNumber method.
this.getExpiryDate = getExpiryDate; // getExpiryDate method.
this.getCardType = getCardType; // getCardType method.
this.isCardNumber = isCardNumber; // isCardNumber method.
this.isExpiryDate = isExpiryDate; // isExpiryDate method.
this.luhnCheck = luhnCheck;// luhnCheck method.
return this;
}

function checkCardNumber() {
var argv = checkCardNumber.arguments;
var argc = checkCardNumber.arguments.length;
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
var year = (argc > 1) ? argv[1] : this.year;
var month = (argc > 2) ? argv[2] : this.month;

this.setCardNumber(cardnumber);
this.setExpiryDate(year, month);

if (!this.isCardNumber())
return false;
if (!this.isExpiryDate())
return false;

return true;
}

String getCardType()
return the cardtype.

function getCardType() {
return this.cardtype;
}

String getExpiryDate()
return the expiry date.

function getExpiryDate() {
return this.month + "/" + this.year;
}



function isCardNumber() {
var argv = isCardNumber.arguments;
var argc = isCardNumber.arguments.length;
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
if (!this.luhnCheck())
return false;

for (var n = 0; n < this.len.size; n++)
if (cardnumber.toString().length == this.len[n]) {
for (var m = 0; m < this.rules.size; m++) {
var headdigit = cardnumber.substring(0, this.rules[m].toString().length);
if (headdigit == this.rules[m])
return true;
}
return false;
}
return false;
}


function isExpiryDate() {
var argv = isExpiryDate.arguments;
var argc = isExpiryDate.arguments.length;

year = argc > 0 ? argv[0] : this.year;
month = argc > 1 ? argv[1] : this.month;

if (!isNum(year+""))
return false;
if (!isNum(month+""))
return false;
today = new Date();
expiry = new Date(year, month);
if (today.getTime() > expiry.getTime())
return false;
else
return true;
}


function isNum(argvalue) {
argvalue = argvalue.toString();

if (argvalue.length == 0)
return false;

for (var n = 0; n < argvalue.length; n++)
if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
return false;

return true;
}

function luhnCheck() {
var argv = luhnCheck.arguments;
var argc = luhnCheck.arguments.length;

var CardNumber = argc > 0 ? argv[0] : this.cardnumber;

if (! isNum(CardNumber)) {
return false;
}

var no_digit = CardNumber.length;
var oddoeven = no_digit & 1;
var sum = 0;

for (var count = 0; count < no_digit; count++) {
var digit = parseInt(CardNumber.charAt(count));
if (!((count & 1) ^ oddoeven)) {
digit *= 2;
if (digit > 9)
digit -= 9;
}
sum += digit;
}
if (sum % 10 == 0)
return true;
else
return false;
}

function makeArray(size) {
this.size = size;
return this;
}

function setCardNumber(cardnumber) {
this.cardnumber = cardnumber;
return this;
}

function setCardType(cardtype) {
this.cardtype = cardtype;
return this;
}

function setExpiryDate(year, month) {
this.year = year;
this.month = month;
return this;
}

function setLen(len) {
// Create the len array.
if (len.length == 0 || len == null)
len = "13,14,15,16,19";

var tmplen = len;
n = 1;
while (tmplen.indexOf(",") != -1) {
tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
n++;
}
this.len = new makeArray(n);
n = 0;
while (len.indexOf(",") != -1) {
var tmpstr = len.substring(0, len.indexOf(","));
this.len[n] = tmpstr;
len = len.substring(len.indexOf(",") + 1, len.length);
n++;
}
this.len[n] = len;
return this;
}

function setRules(rules) {
// Create the rules array.
if (rules.length == 0 || rules == null)
rules = "0,1,2,3,4,5,6,7,8,9";

var tmprules = rules;
n = 1;
while (tmprules.indexOf(",") != -1) {
tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
n++;
}
this.rules = new makeArray(n);
n = 0;
while (rules.indexOf(",") != -1) {
var tmpstr = rules.substring(0, rules.indexOf(","));
this.rules[n] = tmpstr;
rules = rules.substring(rules.indexOf(",") + 1, rules.length);
n++;
}
this.rules[n] = rules;
return this;
}
// End -->
</script>


<TITLE>Customer Information Form</TITLE>
</HEAD>
<BODY BGCOLOR=Cornsilk>
<H1 ALIGN=Center><FONT COLOR=Navy>Z's Mortgages - Customer Information Form</FONT></H1>
<HR WIDTH=90% COLOR=Navy>
<BR>

<!---Mortgage Calculator Form--->

<H2 ALIGN=Center>Mortgage Calculator</H2>
<CENTER>
<FORM NAME="mcalc">
<TABLE BGCOLOR="black" CELLPADDING="2"><TR><TD>
<TABLE BGCOLOR="wheat" CELLSPACING="10">
<TR>
<TD>Mortgage Amount:</TD>
<TD><input type="text" name="amount" /></TD>
</TR>
<TR>
<TD>Yearly Interest Rate:</TD>
<TD><INPUT TYPE="text" NAME="rate" /></TD>
</TR>
<TR>
<TD>Years Length of Mortgage:</TD>
<TD><INPUT TYPE="text" NAME="length" /></td>
</TR>
<TR><TD COLSPAN="2"><HR/></TD></TR>
<TR>
<TD>Monthly Payment:</TD>
<TD><INPUT TYPE="text" NAME="payment" /></TD>
</TR>
<TR>
<TD>Total Payments:</TD>
<TD><INPUT TYPE="text" NAME="total" /></TD>
</TR>
<TR>
<TD COLSPAN="2" WIDTH="100%">
<INPUT TYPE="button" VALUE="Calculate Payments"
onclick="payments();" />
<INPUT TYPE="reset" VALUE="Clear">
</TD></TR>
</TABLE>
</TD></TR></TABLE>
</FORM>
</CENTER><!---End--->

<BR><BR><BR>
<H3 ALIGN=Center>Please Enter Your Information to Process Your Request
for More Information Regarding Our Services</H3>
<HR WIDTH=90% COLOR=Navy>
<BR><BR>



<!---Customer Request Form--->

<FORM ACTION="Thankyou.html" METHOD="POST">
<CENTER>
<IMG SRC="images\custsvc.jpg" ALT="Customer Service Image">
<BR>
<P>Personal credit card information is required as a $2.00 service fee applies.<BR>
The merchant name on your credit card statement for these charges will be listed as "Z's Mortgages".</P>
</CENTER>
<BR>
<B><EM>(Optional Fields in Italic)</EM>
<BR><BR>
<U>Customer Information</U></B>
<P>
First Name: <INPUT TYPE="text" SIZE="20" NAME="custfirstname">
<BR>
Last Name: <INPUT TYPE="text" SIZE="20" NAME="custlastname">
<BR>
Address: <INPUT TYPE="text" SIZE="40" NAME="custaddr1">
<BR>
<EM>Address Line 2</EM>: <INPUT TYPE="text" SIZE="40" NAME="custaddr2">
<BR>
City: <INPUT TYPE="text" SIZE="20" NAME="custcity">
<BR>
State:
<SELECT NAME="custstate">
<OPTION VALUE="al">AL (Alabama)
<OPTION VALUE="ak">AK (Alaska)
<OPTION VALUE="az">AZ (Arizona)
<OPTION VALUE="ar">AR (Arkansas)
<OPTION VALUE="ca">CA (California)
<OPTION VALUE="co">CO (Colorado)
<OPTION VALUE="ct">CT (Connecticut)
<OPTION VALUE="de">DE (Delaware)
<OPTION VALUE="dc">DC (District of Columbia)
<OPTION VALUE="fl">FL (Florida)
<OPTION VALUE="ga">GA (Georgia)
<OPTION VALUE="hi">HI (Hawaii)
<OPTION VALUE="id">ID (Idaho)
<OPTION VALUE="il">IL (Illisnois)
<OPTION VALUE="in">IN (Indiana)
<OPTION VALUE="ia">IA (Iowa)
<OPTION VALUE="ks">KS (Kansas)
<OPTION VALUE="ky">KY (Kentucky)
<OPTION VALUE="la">LA (Louisiana)
<OPTION VALUE="me">ME (Maine)
<OPTION VALUE="md">MD (Maryland)
<OPTION VALUE="ma">MA (Massachusetts)
<OPTION VALUE="mi">MI (Michigan)
<OPTION VALUE="mn">MN (Minnesota)
<OPTION VALUE="ms">MS (Mississippi)
<OPTION VALUE="mo">MO (Missouri)
<OPTION VALUE="mt">MT (Montana)
<OPTION VALUE="ne">NE (Nebraska)
<OPTION VALUE="nv">NV (Nevada)
<OPTION VALUE="nh">NH (New Hampshire)
<OPTION VALUE="nj">NJ (New jersey)
<OPTION VALUE="nm">NM (New Mexico)
<OPTION VALUE="ny">NY (New York)
<OPTION VALUE="nc">NC (North Carolina)
<OPTION VALUE="nd">ND (North Dakota)
<OPTION VALUE="oh">OH (Ohio)
<OPTION VALUE="ok">OK (Oklahoma)
<OPTION VALUE="or">OR (Oregon)
<OPTION VALUE="pa">PA (Pennsylvania)
<OPTION VALUE="ri">RI (Rhode Island)
<OPTION VALUE="sc">SC (South Carolina)
<OPTION VALUE="sd">SD (South Dakota)
<OPTION VALUE="tn">TN (Tennessee)
<OPTION VALUE="tx">TX (Texas)
<OPTION VALUE="ut">UT (Utah)
<OPTION VALUE="vt">VT (Vermont)
<OPTION VALUE="va">VA (Virginia)
<OPTION VALUE="wa">WA (Washington)
<OPTION VALUE="wv">WV (West Virginia)
<OPTION VALUE="wi">WI (Wisconsin)
<OPTION VALUE="wy">WY (Wyoming)
</SELECT>
<BR>
Zip Code: <INPUT TYPE="text" SIZE="10" MAXLENGTH="10" NAME="custzip">
<BR>
Phone #: ( <INPUT TYPE="text" SIZE="3" MAXLENGTH="3" NAME="custareacode"> )
<INPUT TYPE="text" SIZE="3" MAXLENGTH="3" NAME="custphoneprefix"> -
<INPUT TYPE="text" SIZE="4" MAXLENGTH="4" NAME="custphoneend">
<BR>
Date of Birth:
<SELECT NAME="custbirthmonth">
<OPTION VALUE="1">01
<OPTION VALUE="2">02
<OPTION VALUE="3">03
<OPTION VALUE="4">04
<OPTION VALUE="5">05
<OPTION VALUE="6">06
<OPTION VALUE="7">07
<OPTION VALUE="8">08
<OPTION VALUE="9">09
<OPTION VALUE="10">10
<OPTION VALUE="11">11
<OPTION VALUE="12">12
</SELECT> /
<SELECT NAME="custbirthday">
<OPTION VALUE="1">01
<OPTION VALUE="2">02
<OPTION VALUE="3">03
<OPTION VALUE="4">04
<OPTION VALUE="5">05
<OPTION VALUE="6">06
<OPTION VALUE="7">07
<OPTION VALUE="8">08
<OPTION VALUE="9">09
<OPTION VALUE="10">10
<OPTION VALUE="11">11
<OPTION VALUE="12">12
<OPTION VALUE="13">13
<OPTION VALUE="14">14
<OPTION VALUE="15">15
<OPTION VALUE="16">16
<OPTION VALUE="17">17
<OPTION VALUE="18">18
<OPTION VALUE="19">19
<OPTION VALUE="20">20
<OPTION VALUE="21">21
<OPTION VALUE="22">22
<OPTION VALUE="23">23
<OPTION VALUE="24">24
<OPTION VALUE="25">25
<OPTION VALUE="26">26
<OPTION VALUE="27">27
<OPTION VALUE="28">28
<OPTION VALUE="29">29
<OPTION VALUE="30">30
<OPTION VALUE="31">31
</SELECT> /
<SELECT NAME="custbirthyear">
<OPTION VALUE="1900">1900
<OPTION VALUE="1901">1901
<OPTION VALUE="1902">1902
<OPTION VALUE="1903">1903
<OPTION VALUE="1904">1904
<OPTION VALUE="1905">1905
<OPTION VALUE="1906">1906
<OPTION VALUE="1907">1907
<OPTION VALUE="1908">1908
<OPTION VALUE="1909">1909
<OPTION VALUE="1910">1910
<OPTION VALUE="1911">1911
<OPTION VALUE="1912">1912
<OPTION VALUE="1913">1913
<OPTION VALUE="1914">1914
<OPTION VALUE="1915">1915
<OPTION VALUE="1916">1916
<OPTION VALUE="1917">1917
<OPTION VALUE="1918">1918
<OPTION VALUE="1919">1919
<OPTION VALUE="1920">1920
<OPTION VALUE="1921">1921
<OPTION VALUE="1922">1922
<OPTION VALUE="1923">1923
<OPTION VALUE="1924">1924
<OPTION VALUE="1925">1925
<OPTION VALUE="1926">1926
<OPTION VALUE="1927">1927
<OPTION VALUE="1928">1928
<OPTION VALUE="1929">1929
<OPTION VALUE="1930">1930
<OPTION VALUE="1931">1931
<OPTION VALUE="1932">1932
<OPTION VALUE="1933">1933
<OPTION VALUE="1934">1934
<OPTION VALUE="1935">1935
<OPTION VALUE="1936">1936
<OPTION VALUE="1937">1937
<OPTION VALUE="1938">1938
<OPTION VALUE="1939">1939
<OPTION VALUE="1940">1940
<OPTION VALUE="1941">1941
<OPTION VALUE="1942">1942
<OPTION VALUE="1943">1943
<OPTION VALUE="1944">1944
<OPTION VALUE="1945">1945
<OPTION VALUE="1946">1946
<OPTION VALUE="1947">1947
<OPTION VALUE="1948">1948
<OPTION VALUE="1949">1949
<OPTION VALUE="1950">1950
<OPTION VALUE="1951">1951
<OPTION VALUE="1952">1952
<OPTION VALUE="1953">1953
<OPTION VALUE="1954">1954
<OPTION VALUE="1955">1955
<OPTION VALUE="1956">1956
<OPTION VALUE="1957">1957
<OPTION VALUE="1958">1958
<OPTION VALUE="1959">1959
<OPTION VALUE="1960">1960
<OPTION VALUE="1961">1961
<OPTION VALUE="1962">1962
<OPTION VALUE="1963">1963
<OPTION VALUE="1964">1964
<OPTION VALUE="1965">1965
<OPTION VALUE="1966">1966
<OPTION VALUE="1967">1967
<OPTION VALUE="1968">1968
<OPTION VALUE="1969">1969
<OPTION VALUE="1970">1970
<OPTION VALUE="1971">1971
<OPTION VALUE="1972">1972
<OPTION VALUE="1973">1973
<OPTION VALUE="1974">1974
<OPTION VALUE="1975">1975
<OPTION VALUE="1976">1976
<OPTION VALUE="1977">1977
<OPTION VALUE="1978">1978
<OPTION VALUE="1979">1979
<OPTION VALUE="1980">1980
<OPTION VALUE="1981">1981
<OPTION VALUE="1982">1982
<OPTION VALUE="1983">1983
<OPTION VALUE="1984">1984
<OPTION VALUE="1985">1985
<OPTION VALUE="1986">1986
<OPTION VALUE="1987">1987
<OPTION VALUE="1988">1988
<OPTION VALUE="1989">1989
<OPTION VALUE="1990">1990
<OPTION VALUE="1991">1991
<OPTION VALUE="1992">1992
<OPTION VALUE="1993">1993
<OPTION VALUE="1994">1994
<OPTION VALUE="1995">1995
<OPTION VALUE="1996">1996
<OPTION VALUE="1997">1997
<OPTION VALUE="1998">1998
<OPTION VALUE="1999">1999
<OPTION VALUE="2000">2000
</SELECT>
</P>
<BR>



<center>
<form name="ThisForm">
Card Number: <input name="CardNumber" size="16" maxlength="19"><br>
Card Type:
<INPUT TYPE="radio" NAME="CardType" VALUE="MasterCard">Master Card
<select name="CardType">
<option value="MasterCard">MasterCard
<option value="VisaCard">Visa
<option value="AmExCard">American Express
<option value="DiscoverCard">Discover
</select>
<br>
Expiration Date: Month
<select name="ExpMon">
<option value="1" selected>1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
<option value="6">6
<option value="7">7
<option value="8">8
<option value="9">9
<option value="10">10
<option value="11">11
<option value="12">12
</select>
Year <input name="ExpYear" size="4" maxlength="4"><br>
<input type="button" value="Check" OnClick="CheckCardNumber(this.form)"><br>
</form>
</center>

<BR>
</BODY>
</HTML>