Example with forms, functions, fields, numbers and strings

Here you see a function with some statements for calculate some output.

Results:

xxxx
xxxx
xxxx
xxxx
xxxx
xxxx

Comments:

You see the default output in the fields are 'aaa', 'bbb' and 'ccc'. After clicking: '678.4', '81.8999999' and 'multimedia programming'. Did you understand?

The object 'document' has an object 'form7' and in that form there are fields: 'out1', 'out2' en 'out3'. The field only can take over the value if you has programmed '.value', as seen in the statement document.form7.out2.value = 678.4.

Remarks:

As you see, you have to resize the length of some fields, because some output strings are to long.

The use of 'this.form' in a function can be studied in JavaScript handbooks.

Enschede, 8 jan 2001; updated: jan 28, 2003.