Please help me out here. I can’t figure out for the life of me why this BMI calculator works on one page, but not the other. Please excuse the way the pages look I didn’t upload all the files.
This one works:
[URL=”http://www.4yourbody.info/test/1″]http://www.4yourbody.info/test/1
This one doesn’t:
[URL=”http://www.4yourbody.info/test/2″]http://www.4yourbody.info/test/2
I received this reply to an earlier post:
f.wt has no properties
compute() (line 25)
onclick(click clientX=0, clientY=0)2 (line 1)
[Break on this error] w = f.wt.value;
I have no idea what that means. I don’t know anything when it comes to Java. The Java Script that controls the calculator is in the head tag. Can you tell me how to fix this problem? What line number the error is on? What the value should be? I got permission from the National Institute of Health to use this calculator and can’t get it to work when I put it in my page. Thought it would be easy – fooled me.
The variable "f" appears to reference a FORM tag. The ".wt" part should reference a form field whose name is "wt" inside the FORM tag. If you do not have any form fields named "wt" inside the FORM, that's where your error is coming from.[/QUOTE]
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="200"
SUMMARY="This table is used for layout purposes only." id="table92">
<TR>
<TD BGCOLOR="#6F48B3" WIDTH="200" COLSPAN="3">
<TABLE WIDTH="209" BORDER="0" CELLPADDING="0"
CELLSPACING="0" SUMMARY="This table is used for layout purposes only." id="table93">
<TR>
<TD BGCOLOR="#FFFFFF">
<IMG SRC="../../images/body_mass_index_calculator/bmi-e_01.gif" BORDER="0" ALT="Standard Measurements"
WIDTH="105" HEIGHT="28"></TD>
<TD BGCOLOR="#FFFFFF"><A HREF="../general_health/bmi-m.htm">
<IMG SRC="../../images/body_mass_index_calculator/bmi-e_02.gif" BORDER="0" ALT="View Metric Measurements"
WIDTH="104" HEIGHT="28"></A></TD>
</TR>
</TABLE></TD>
</TR>
<TR>
<TD BGCOLOR="#6F48B3" WIDTH="13">
<IMG BORDER="0" SRC="../../images/spacer.gif" WIDTH="12" HEIGHT="1" ALT=" "></TD>
<TD BGCOLOR="#6F48B3" WIDTH="184">
<TABLE BORDER="0" CELLSPACING="0" WIDTH="185"
BGCOLOR="#FFFFFF" CELLPADDING="2"
SUMMARY="This table is used for layout purposes only." id="table94">
<TR>
<TD WIDTH="199" COLSPAN="3" ALIGN="center">
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0"
WIDTH="150" SUMMARY="This table is used for layout purposes only." id="table95">
<TR>
<TD ROWSPAN="3" ALIGN="right" WIDTH="50">
<IMG SRC="../../images/body_mass_index_calculator/bmi_1-4.gif" ALT=" " WIDTH="36" HEIGHT="201"></TD>
<TD VALIGN="top" WIDTH="50">
<IMG SRC="../../images/body_mass_index_calculator/bmi_2-4.gif" ALT=" " WIDTH="50" HEIGHT="76"></TD>
<TD ROWSPAN="3" ALIGN="left" WIDTH="92">
<IMG SRC="../../images/body_mass_index_calculator/bmi_4-4.gif" ALT=" " WIDTH="57" HEIGHT="201"></TD>
</TR>
<TR>
<TD ALIGN="center" WIDTH="50">
<INPUT NAME="bmi" TYPE="text" SIZE="4" STYLE="text-align: center"></TD>
</TR>
<TR>
<TD VALIGN="bottom" WIDTH="50">
<IMG SRC="../../images/body_mass_index_calculator/bmi_3-4.gif" ALT=" " WIDTH="50" HEIGHT="96"></TD>
</TR>
</TABLE> </TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"><LABEL FOR="htf"><B>Your
Height:</B></LABEL></SPAN></TD>
<TD WIDTH="45" ALIGN="left"><INPUT
TYPE="text" NAME="htf" SIZE="3" ID="htf"></TD>
<TD WIDTH="50" ALIGN="left"><INPUT
TYPE="text" NAME="hti" SIZE="3" ID="hti"></TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"> </SPAN></TD>
<TD WIDTH="45" ALIGN="left"><B><SPAN
STYLE="font-size: 10pt;">(feet)</SPAN></B></TD>
<TD WIDTH="53" ALIGN="left"><B><SPAN
STYLE="font-size: 10pt;">(inches)</SPAN></B></TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"><B><LABEL FOR="wt">Your
Weight:</LABEL></B></SPAN></TD>
<TD WIDTH="45" ALIGN="left">
<INPUT TYPE="text" NAME="wt" SIZE="3"
ID="wt"></TD>
<TD WIDTH="53" ALIGN="left"> </TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"> </SPAN></TD>
<TD ALIGN="left" COLSPAN="2"> <B><SPAN
STYLE="font-size: 10pt;">(pounds)</SPAN></B></TD>
</TR>
<TR>
<TD COLSPAN="3" ALIGN="center"><INPUT TYPE="button"
VALUE="Give Me My BMI" ONCLICK="self.compute();"></TD>
</TR>
</TABLE></TD>
<TD BGCOLOR="#6F48B3" WIDTH="13">
<IMG BORDER="0" SRC="../../images/spacer.gif" WIDTH="12" HEIGHT="1" ALT=" "></TD>
</TR>
<TR>
<TD BGCOLOR="#6F48B3" COLSPAN="3" WIDTH="100%"
ALIGN="CENTER"> </TD>
</TR>
</TABLE> </TD>
</TR>
</TABLE>
var f = self.document.forms[0];
var f = document.getElementById("frmBMICalc");
<IMG SRC="images/bmi_2-4.gif" ALT=" " WIDTH="50" HEIGHT="76"></TD>
<TD ROWSPAN="3" ALIGN="left" WIDTH="92">
<IMG SRC="images/bmi_4-4.gif" ALT=" " WIDTH="57" HEIGHT="201"></TD>
</TR>
<TR>
<TD ALIGN="center" WIDTH="50">
<INPUT NAME="bmi" TYPE="text" SIZE="4" STYLE="text-align: center"></TD>
</TR>
<TR>
<TD VALIGN="bottom" WIDTH="50">
<IMG SRC="images/bmi_3-4.gif" ALT=" " WIDTH="50" HEIGHT="96"></TD>
</TR>
</TABLE> </TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"><LABEL FOR="htf"><B>
Your Height:</B></LABEL></SPAN></TD>
<TD WIDTH="45" ALIGN="left"><INPUT
TYPE="text" NAME="htf" SIZE="3" ID="htf"></TD>
<TD WIDTH="50" ALIGN="left"><INPUT
TYPE="text" NAME="hti" SIZE="3" ID="hti"></TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"> </SPAN></TD>
<TD WIDTH="45" ALIGN="left"><B><SPAN
STYLE="font-size: 10pt;">(feet)</SPAN></B></TD>
<TD WIDTH="53" ALIGN="left"><B><SPAN
STYLE="font-size: 10pt;">(inches)</SPAN></B></TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"><B><LABEL FOR="wt">
Your Weight:</LABEL></B></SPAN></TD>
<TD WIDTH="45" ALIGN="left">
<P> <INPUT TYPE="text" NAME="wt" SIZE="3"
ID="wt"></P></TD>
<TD WIDTH="53" ALIGN="left"> </TD>
</TR>
<TR>
<TD WIDTH="95"><SPAN
STYLE="font-size: 10pt;"> </SPAN></TD>
<TD ALIGN="left" COLSPAN="2"> <B><SPAN
STYLE="font-size: 10pt;">(pounds)</SPAN></B></TD>
</TR>
<TR>
<TD COLSPAN="3" ALIGN="center"><INPUT TYPE="button"
VALUE="Compute BMI" ONCLICK="self.compute();"></TD>
</TR>
</TABLE></TD>
<TD BGCOLOR="#6F48B3" WIDTH="13">
<IMG BORDER="0" SRC="images/spacer.gif" WIDTH="12" HEIGHT="1" ALT=" "></TD>
</TR>
<TR>
<TD BGCOLOR="#6F48B3" COLSPAN="3" WIDTH="100%"
ALIGN="CENTER"> </TD>
</TR>
</TABLE> </TD>
</TR>
</TABLE> </FORM>
0.1.9 — BETA 5.25