Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

HTML Custom Calculator

Avatar of gouder
gouder asked on
Web Languages and StandardsScripting Languages
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>
<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 /> 
Click this button to calculate Your Rewards: <INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON onClick=temp(this.form)>
 <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:

<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);">

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

Any suggestions?
Avatar of Michel Plungjan
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers