Originally Posted by Old Pedant
DOH on me! OF COURSE!
The whole reason his code didn't work was because he used
document.form instead of
Good eyes, Philip!
Follow Logic Ali's advice - use the error console!
Another good reason to use
var f = document.forms;
But as you say id is preferred
var f = document.getElementById("formid");