The script works fine in IE and Safari, but I get no response from Firefox.I don't know what's wrong.
Code is as follows:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
<script type="text/javascript">
function updateprice()
{
var A_price=0;
var B_price=0;
var amount_price=0;
var amount_A=0;
var amount_B=0;
registertype=(autoSumForm.registertype.value);
switch (registertype) {
case "dh" :
A_year=(autoSumForm.A_year.value);
cost_A=(autoSumForm.cost_A.value);
amount_A=A_year*cost_A;
month=(autoSumForm.B_month.value);
B_price=(autoSumForm.B_plan.value);
amount_B=B_price*month;
break;
case "d" :
A_year=(autoSumForm.A_year.value);
cost_A=(autoSumForm.cost_A.value);
amount_A=A_year*cost_A;
break;
case "h" :
month=(autoSumForm.B_month.value);
B_price=(autoSumForm.B_plan.value);
amount_B=B_price*month;
break;
}
/*
A_year=(autoSumForm.A_year.value);
cost_A=(autoSumForm.cost_A.value);
amount_A=A_year*cost_A;
month=(autoSumForm.B_month.value);
B_price=(autoSumForm.B_plan.value);
amount_B=B_price*month;
*/
amount_price=amount_A+amount_B;
autoSumForm.price.value=amount_price;
}
// End -->
</script>
</head>
<body>
<form name="autoSumForm">
<p>
<input name="registertype" type="hidden" value="dh" />
Price A
<input name="cost_A" value="450" size="7" />
USD/Year
<select name="A_year" size="1" onChange="updateprice();">
<option value="0" selected="selected">Select</option>
<option value="1">1 year</option>
<option value="2">2 years </option>
<option value="3">3 years </option>
</select>
+ Price B
<select name="B_plan" onChange="updateprice();">
<option value="">Select</option>
<option value="80">Plan A = 80 USD/year</option>
<option value="150">Plan B = 150 USD/year</option>
<option value="500">Plan C = 500 USD/year</option>
</select> <select name="B_month" onChange="updateprice();">
<option value="">Select</option>
<option value="12">1 year</option>
<option value="24">2 years</option>
</select><br />
= <input name="price" type="text" />
</p></form>
</body>
</html>
or see
Thanks you.
Code is as follows:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
<script type="text/javascript">
function updateprice()
{
var A_price=0;
var B_price=0;
var amount_price=0;
var amount_A=0;
var amount_B=0;
registertype=(autoSumForm.registertype.value);
switch (registertype) {
case "dh" :
A_year=(autoSumForm.A_year.value);
cost_A=(autoSumForm.cost_A.value);
amount_A=A_year*cost_A;
month=(autoSumForm.B_month.value);
B_price=(autoSumForm.B_plan.value);
amount_B=B_price*month;
break;
case "d" :
A_year=(autoSumForm.A_year.value);
cost_A=(autoSumForm.cost_A.value);
amount_A=A_year*cost_A;
break;
case "h" :
month=(autoSumForm.B_month.value);
B_price=(autoSumForm.B_plan.value);
amount_B=B_price*month;
break;
}
/*
A_year=(autoSumForm.A_year.value);
cost_A=(autoSumForm.cost_A.value);
amount_A=A_year*cost_A;
month=(autoSumForm.B_month.value);
B_price=(autoSumForm.B_plan.value);
amount_B=B_price*month;
*/
amount_price=amount_A+amount_B;
autoSumForm.price.value=amount_price;
}
// End -->
</script>
</head>
<body>
<form name="autoSumForm">
<p>
<input name="registertype" type="hidden" value="dh" />
Price A
<input name="cost_A" value="450" size="7" />
USD/Year
<select name="A_year" size="1" onChange="updateprice();">
<option value="0" selected="selected">Select</option>
<option value="1">1 year</option>
<option value="2">2 years </option>
<option value="3">3 years </option>
</select>
+ Price B
<select name="B_plan" onChange="updateprice();">
<option value="">Select</option>
<option value="80">Plan A = 80 USD/year</option>
<option value="150">Plan B = 150 USD/year</option>
<option value="500">Plan C = 500 USD/year</option>
</select> <select name="B_month" onChange="updateprice();">
<option value="">Select</option>
<option value="12">1 year</option>
<option value="24">2 years</option>
</select><br />
= <input name="price" type="text" />
</p></form>
</body>
</html>
or see
Thanks you.