Examples of JavaScript by Baron and Siepmann

column.htm - vertical columns of inputs where tab takes you down a column rather than across a row.

multi.htm - randomly allocates subject to one of three versions.

program.htm (with frames visible.htm and hidden.htm) - randomizing question order separately for each subject.

progchk1.htm (with frames visible.htm and hidden.htm) - randomizing question order separately for each subject, with error checking so that response must be number from 1 to 5.

progchk2.htm (with frames visible.htm and hidden.htm) - randomizing question order separately for each subject, with error checking so that response must include one of the letters u, v, or y.

remove.htm - removes carriage returns and tabs in textarea responses.

process.htm - counts and times subject's viewing of a stimulus.

A complete example: ohp1.htm
Introductory frame: ohp1s.htm
Hidden frame: ohp1m.htm