Hello, Just out of the blue this script stop working. I can't figure out the problem. Any help is much appreciated. webpage = http://www.bbhydraulics.com/pumpcalculator2.html code before <head> tag <script language="JavaScript"> <!-- //Script by Tom Richardson Jr. //Permission to use this scipt is permited as long as this //part stays intact. //If you have any questions, e-mail me at gooftroop@geocities.com //or visit my website at http://home.rmci.net/gooftroop //This is just a basic calculator that will do the exponential math. //Or, in basic terms, will calculate powers of any given number. //Just another user-friendly calculator that uses terms and text //fields. //Have fun!! function calc() { a = document.form1.a.value; b = document.form1.b.value; c = document.form1.c.value; d = (26 * a) * ((2 * b) - c) * ((c - b) / 2); e = (31 * a) * ((2 * b) - c) * ((c - b) / 2); f = (47 * a) * ((2 * b) - c) * ((c - b) / 2); document.form1.total.value = d; document.form1.total2.value = e; document.form1.total3.value = f } //--> </script> <HEAD> Code (markup): form code in <body> tag. <form name="form1"> <center> <table bordercolorlight="#FF6633" bordercolordark="#CC3333" border="2" cellpadding="1" cellspacing="1" height="332" width="454"> <tbody> <tr bgcolor="#ffcc99"> <td colspan="3" height="24" align="center"><font face="Times New Roman, Times, serif" size="3"><strong> <h4>Hydraulic Gear Pump and Motor GPM Calculator</h4></strong></font></td></tr> <tr> <td height="228" width="151"> <div align="center"><font color="#ffffff" size="2"><strong>Enter Width of the Gear<br /> <input name="a" size="15" maxlength="15" type="text" /></strong></font><font color="#ffffff"><br /> <strong><font size="2">Enter Diameter of the Gear Hole<br /> </font></strong><input name="b" size="15" maxlength="15" type="text" /></font><font color="#ffffff"><br /> </font><strong><font size="2"><font color="#ffffff">Enter Length of the Gear Hole</font><br /> <input name="c" size="15" maxlength="15" type="text" /></font></strong></div></td> <td height="228" width="99"> <div align="center"> <input value="Calculate" onclick="calc()" name="Calculate" type="button" /><br /> <br /><br /> <input value="Reset" name="reset" type="reset" /></div></td> <td height="228" width="181"> <div align="center"><font color="#ffffff" size="2"><strong>GPM</strong></font><font color="#ffffff"> </font><font color="#ffffff" size="2"><strong>@1,000 RPM </strong></font><font color="#ffffff"><br /> <input name="total" size="15" maxlength="15" type="text" /></font><font color="#ffffff"><br /> <strong><font size="2">GPM @ 1,2000 RPM<br /> <input name="total2" size="15" maxlength="15" type="text" /><br /> GPM @ 1,800 RPM</font></strong></font><font color="#ffffff"><br /> <input name="total3" size="15" maxlength="15" type="text" /></font></div></td></tr></tbody></table> <p><font color="#000000" face="Times New Roman, Times, serif" size="3"><strong><font color="#990033"><img alt="" title="" src="images/geargpm.jpg" height="166" width="235" /><br /> </font></strong></font></p></center></form> Code (markup):
<script language="JavaScript"> <!-- //Script by Tom Richardson Jr. //Permission to use this scipt is permited as long as this //part stays intact. //If you have any questions, e-mail me at gooftroop@geocities.com //or visit my website at http://home.rmci.net/gooftroop //This is just a basic calculator that will do the exponential math. //Or, in basic terms, will calculate powers of any given number. //Just another user-friendly calculator that uses terms and text //fields. //Have fun!! function calc() { a = document.form1.a.value; b = document.form1.b.value; c = document.form1.c.value; d = (26 * a) * ((2 * b) - c) * ((c - b) / 2); e = (31 * a) * ((2 * b) - c) * ((c - b) / 2); f = (47 * a) * ((2 * b) - c) * ((c - b) / 2); document.form1.total.value = d; document.form1.total2.value = e; [FONT=Arial Black][U] document.form1.total3.value = f [/U][/FONT] forgot ; } //--> </script> <HEAD> Code (markup): figure it out forgot the semicolon. for some reason it got deleted. Man took me forever to find that.
Yeah. That's pain in the head thing. For debugging javascript, you could use Google Chrome's JavascriptConsole or FireBug in Firefox. Also, if you use some editors that supports javascript, you might be able to find the missing semicolons or braces, because of the color change.