Web hosting company - 1317Chapter 51 .Application: A Poor Man s Order Form
Monday, December 31st, 20071317Chapter 51 .Application: A Poor Man s Order Form Creating a row of entry fields is a bit more complex, but not much. Instead of assigning just a word to each cell, you assemble an entire object definition. You use the columnWidths array to define the size for each field (which therefore defines the width of the table cell in the column). columnHead values are assigned to the field s NAME attribute. Each column s fields have the same name, no matter how many rows exist. Finally, the onChange event handler invokes the calculate() method, passing the form and, most importantly, the row number, which comes into this function as a parameter (see the following section). Some JavaScript language cleanup The final function in the Head script is an empty function for initialize(). This function is the one that JavaScript 1.1-level browsers activate after the document loads into them: // do nothing when JavaScript 1.1 browser calls here function initialize() {} //–>