[thelist] JavaScript -- calculating & printing

Lauri Vain optima at hot.ee
Mon Apr 9 13:29:59 CDT 2001


Hello everybody,

Could somebody please help me a little with a few lines of JavaScript?

I have six input text fields:
<.input type="text" name="length_meters">
<.input type="text" name="length_feet">

<.input type="text" name="width_meters">
<.input type="text" name="width_feet">

<.input type="text" name="square_meters">
<.input type="text" name="square_feet">


The user will complete one of the fields from the two ones that have the same
prefix. The JavaScript would need to convert the meters into feet or the other
way around (feet into meters) depending on which field the user completes. The
same would go for the "width" field and the "square" field.

The units of the length and width fields are meters and feet (1ft = 0.3048 m).
The units of the square fields are square meters (m2) and square feet (ft2).

The form would have to be submitted and need to contain all of the fields -- the
other field with the same prefix should be filled depending on the user input.

Thanks in advance!

Yours,
Lauri





More information about the thelist mailing list