 <p>If the sample is representative of the page, the the form "myForm" doesn't exist when the script is evaluated. In addition to using <code>document.getElementById</code> (or <code>document.forms.<em>formName</em></code>), you'll need to delay setting <code>var myForm</code> until after the form element is processed or, <a href="http://c2.com/cgi/wiki?GlobalVariablesAreBad" rel="nofollow noreferrer">better yet</a>, pass the form as an argument to the functions rather than using a global variable.</p>