troubleshooting Question

HTML Custom Calculator

Avatar of gouder
gouder asked on
Scripting LanguagesWeb Languages and Standards
4 Comments1 Solution1208 ViewsLast Modified:
I am looking for an alternative way to code the following:

<script type="text/javascript">// <![CDATA[
 hide this script from old browsers
function temp(form)
{
  var f = parseFloat(form.DegF.value, 10);
	var g = parseFloat(form.DegG.value, 10);
	var h = parseFloat(form.DegH.value, 10);
  var c = 0;
	  c = (f * 2)+ (g * 4);
  form.DegC.value = c;
	var d = 0;
	  d = ((h * .02) * 12) + (c * 12) ;
  form.DegD.value = d;
}
<!-- done hiding from old browsers
// ]]></script>
<form>
<h2>What Is Your Estimated Rewards Value With FTR?</h2>
Enter how many people you are connected to on Facebook, Twitter, Email, Etc: <input type="text" name="DegF" value="0" size="15" maxlength="15" /> 
<br /> 
Enter how many businesses you are connected to on LinkedIn, Email, Etc: <input type="text" name="DegG" value="0" size="15" maxlength="15" /> 
<br /> 
nter how many times you share comments, pictures, videos, etc with your networks every month: <input type="text" name="DegH" value="0" size="15" maxlength="15" /> 
<br /> 
<p>
Click this button to calculate Your Rewards: <INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON onClick=temp(this.form)>
<p>
 <br /> Your Estimate Monthly Rewards Would Be $ <input type="text" name="DegC" readonly="readonly" size="15" /> <br /> Your Estimate Annual Rewards Would Be $ <input type="text" name="DegD" readonly="readonly" size="15" /></form>

We were able to imbed the previous code into our system however it would only work on Firefox. After testing out other formats for calculators, we found only on will work on our system. Example:

<form>
<input type=text name=userinput>
<input type=button
onKeyPress="if(document.all){var k=event.keyCode;}else{var k=event.which;}if(!(k>=48&&k<=57)){return false;}"
onClick="var saved=(15-8)*this.form.userinput.value;alert('You saved '+saved);">
</form> 

We need the first code to be converted to the code just about with out the pop up window for results.

Any suggestions?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros