<!--BMR CALCULATOR--> <!-- This part can go in the HEAD of the html file --> <script language="JavaScript" type="text/javascript"> <!-- Copyright 2006, Sandeep Gangadharan --> <!-- For more free scripts go to http://www.sivamdesign.com/scripts/ --> <!-- function get_bmr() { if (document.bmr_calc.weight.value.length == 0) { alert('Weight field is empty!'); return false; } if (document.bmr_calc.height.value.length == 0) { alert('Height field is empty!'); return false; } if (document.bmr_calc.age.value.length == 0) { alert('Age field is empty!'); return false; } if (document.bmr_calc.gender1[0].checked) { document.bmr_calc.result_bmr.value = 665.51+(9.463*(document.bmr_calc.weight.value))+(1.8496*(document.bmr_calc.height.value) * 2.54)-(4.6756*(document.bmr_calc.age.value)); } if (document.bmr_calc.gender1[1].checked) { document.bmr_calc.result_bmr.value = 66.473+(13.751*(document.bmr_calc.weight.value))+(5.0033*(document.bmr_calc.height.value) * 2.54)-(6.55*(document.bmr_calc.age.value)); } num1 = Math.pow(10, 2); document.bmr_calc.result_bmr.value = Math.round(document.bmr_calc.result_bmr.value * num1) / num1; } //--> </script> <!-- This goes into the BODY of the file --> <form name="bmr_calc"> <table border="0" align="center" cellspacing="3" cellpadding="0" width="300" bgcolor="#c0c0c0"> <tr> <td colspan="2" align="center"> <label for="w1"><input type="radio" id="w1" name="gender1" checked /><b>Female</b></label>&nbsp;&nbsp; <label for="m1"><input type="radio" id="m1" name="gender1" /><b>Male</b></label> </td> </tr> <tr> <td align="right"> <b>Weight:</b>&nbsp; </td> <td> <input type="text" name="weight" size="5" /> &nbsp;Kilos </td> </tr> <tr> <td align="right"> <b>Height:</b>&nbsp; </td> <td> <input type="text" name="height" size="5" /> &nbsp;Inches </td> </tr> <tr> <td align="right"> <b>Age:</b>&nbsp; </td> <td> <input type="text" name="age" size="5" /> &nbsp;Inches </td> </tr> <tr> <td align="center" colspan="2"> <input type="button" value="Get Result" onclick="get_bmr()" /> <input type="reset" value="Reset" /> </td> </tr> <tr> <td align="right"> <b>Result:</b>&nbsp; </td> <td> <input type="text" name="result_bmr" size="10" /> </td> </tr> </table> </form>