Solved: Javascript Calculation Doesn't Work in IE

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

WendyM

Thread Starter
Retired Trusted Advisor
Joined
Jun 27, 2003
Messages
4,042
Hi all,
I'm a novice when it comes to Javascript and generally just cobble together things from other sources until it works the way I want. I have some JS that calculates a couple of different fees, based on the amounts entered. This works just fine in Chrome, but doesn't do anything in IE. Any ideas why? Thanks for any help.

Code:
<script type="text/javascript">

function getFees(form) {
//Constant Variables
    const app = Number (0.0005);
    const admin = Number (.004);

//QP
    var qpTotal = Number(form.qpTotal.value);
    var qpReport = Number(form.qpReport.value);
    var appFee = qpTotal * app;
    var adminTotal = qpTotal * admin
    var adminReport = qpReport * admin
    var adminReportCap = adminTotal - 15000
	
    if (appFee < 250) {form.appResult.value = 250
	} else 
	if (appFee >10000) {form.appResult.value = 10000
	} else 	
	{form.appResult.value = appFee;
	}
	
	if (adminTotal < 15000) {form.adminTotalResult.value = 15000
	} else 
	if (adminTotal >350000) {form.adminTotalResult.value=350000
	} 	else 	
	{form.adminTotalResult.value = adminTotal;}
	
	if (adminReport > adminReportCap) {form.adminReportResult.value=adminReportCap}
	else 	
	{form.adminReportResult.value = adminReport;}
}

</script> 

<h3>Fee Calculator</h3>

<form name="fee">


<table cellpadding="3" cellspacing="3">
<tr>
	<td>Total Amount of Qualified Property Purchased</td>
    <td>$ <INPUT  class="input" TYPE="text"  NAME="qpTotal"> </td>
</tr>
<tr>
	<td>Amount of Qualified Property Purchased in Last Reporting Period</td>
    <td>$ <INPUT  class="input" TYPE="text"  NAME="qpReport"> </td>
</tr>
<tr>
	<td colspan="2" class="center"><input name="Calculate" type="button" value="Calculate" onclick="getFees(form)"/></td>
</tr>
<tr>
	<td>Application Fee:</td>
    <td>$ <input name="appResult" disabled="disabled"/></td>
</tr>
<tr>
  <td>Total Administration Fee:</td>
  <td>$
    <input name="adminTotalResult" disabled="disabled"/></td>
</tr>
<tr>
	<td>Administration Fee Due for Reporting Period:</td>
    <td>$ <input name="adminReportResult" disabled="disabled"/></td>
</tr>
</table>
 

WendyM

Thread Starter
Retired Trusted Advisor
Joined
Jun 27, 2003
Messages
4,042
Guam Chris! How the heck are you?

You, sir, are a gentleman and a scholar. Works like a charm. Thanks much. (y)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top