kasar
09-02-2003, 11:21 PM
This seems like it should be simple, there's more to it but if this doesn't work, adding to it wouldn't be helpful. I've tried a few approaches, even copying it from a page I built years ago that still works in all browsers, but I'm apparently missing something.
All it's supposed to do's let you select some radio buttons, and based on the combination, set the value of a text box.
<html>
<head>
<title>Required Fields</title>
<script>
function fee()
{
if (Worksheet.Loan[0].checked && Worksheet.Purpose[0].checked) {fee=415;}
else if (Worksheet.Loan[1].checked && Worksheet.Purpose[0].checked) {fee=540;}
else if (Worksheet.Loan[2].checked && Worksheet.Purpose[1].checked) {fee=490;}
else if (Worksheet.Loan[2].checked && Worksheet.Purpose[2].checked) {fee=490;}
else if (Worksheet.Loan[3].checked && Worksheet.Purpose[1].checked) {fee=490;}
else if (Worksheet.Loan[3].checked && Worksheet.Purpose[2].checked) {fee=490;}
document.Worksheet.MFI_MCA_FEE.value= "$" + fee;
}
</script>
</head>
<body>
<form name="Worksheet">
<input type="RADIO" NAME="Loan" VALUE="Conventional">Conventional
<input type="RADIO" NAME="Loan" VALUE="FHA">FHA
<input type="RADIO" NAME="Loan" VALUE="VA">VA
<br>
<input type="RADIO" NAME="Purpose" VALUE="Purchase">Purchase
<input type="RADIO" NAME="Purpose" VALUE="Refi">Refinance
<br>
Your total is: <br>
<input type="text" name="MFI_MCA_FEE" size=10 maxlength=10 tabindex=30 onChange="fee()">
</form>
</body>
</html>
All it's supposed to do's let you select some radio buttons, and based on the combination, set the value of a text box.
<html>
<head>
<title>Required Fields</title>
<script>
function fee()
{
if (Worksheet.Loan[0].checked && Worksheet.Purpose[0].checked) {fee=415;}
else if (Worksheet.Loan[1].checked && Worksheet.Purpose[0].checked) {fee=540;}
else if (Worksheet.Loan[2].checked && Worksheet.Purpose[1].checked) {fee=490;}
else if (Worksheet.Loan[2].checked && Worksheet.Purpose[2].checked) {fee=490;}
else if (Worksheet.Loan[3].checked && Worksheet.Purpose[1].checked) {fee=490;}
else if (Worksheet.Loan[3].checked && Worksheet.Purpose[2].checked) {fee=490;}
document.Worksheet.MFI_MCA_FEE.value= "$" + fee;
}
</script>
</head>
<body>
<form name="Worksheet">
<input type="RADIO" NAME="Loan" VALUE="Conventional">Conventional
<input type="RADIO" NAME="Loan" VALUE="FHA">FHA
<input type="RADIO" NAME="Loan" VALUE="VA">VA
<br>
<input type="RADIO" NAME="Purpose" VALUE="Purchase">Purchase
<input type="RADIO" NAME="Purpose" VALUE="Refi">Refinance
<br>
Your total is: <br>
<input type="text" name="MFI_MCA_FEE" size=10 maxlength=10 tabindex=30 onChange="fee()">
</form>
</body>
</html>