Assignments    Calendar/Schedule    Table of Contents    Resources    |    MY Assignments    My COIN 70b Home

Marthas COIN 70b Assignment 232

Form Fields with Mathematical Input

TO USE CALCULATOR: Insert a number into the top textfield for "X"
The Result should show up in the bottom two fields

You may also insert a number in ANY of the textfields.
This form uses a JavaScript and the Event Handler "onChange" to calculate the number of any field, depending on the number in any other field.

Calculator

X:
X * 2:
X ^ 2:

Form Template: 232.htm

Formula for Number Squared

(232.htm) Create a page with HTML & JavaScript that includes a form with three input fields. The relationship of the values of the fields are such that the second field is twice the value of the first field, and the third field is the square of the first field. The user can input a number in any field and onChange the appropriate values are outputted to the other fields.

What should happen - if you put :
4 into the 1st field then 8 shows up in the 2nd field, & 16 in the 3rd field.
10 into the 2nd field then 5 shows up in the 1st field, & 25 in the 3rd field.
36 into the 3rd field then 6 shows up in the 1st field, & 12 in the 2nd field.

RETURN