Forum Moderators: open
There is a table of four forms, two for input, a calculate button, and an output form. Each form has a NAME, which is used to pass the variable name to the javascript code.
So I have a line:
<TD><FORM NAME="elevation" action="calc.js"><input type="text" size="8"></FORM></TD>
which accepts the elevation gain, and in my javascript file I have a line:
feet = parseFloat(document.elevation.elements[0].value)
which gets it ready for further computations.
It works fine, but NAME is clearly not a valid attribute of FORM. But every javascript calculator I have seen uses that construct, including a simple email address verifier from W3Schools [w3schools.com]!
Moving the NAME attribute into the INPUT field did not work (i.e. the program stopped working).
Any help will obviously be much appreciated :) :)
The W3C section 17.3 The FORM element [w3.org] does list name as an attribute of form:
This attribute names the element so that it may be referred to from style sheets or scripts. Note. This attribute has been included for backwards compatibility. Applications should use the id attribute to identify elements.
but their validator, with a transitional DOCTYPE, tells me:
Line 24, column 11: there is no attribute "NAME" (explain...).
<form name="myForm"