View Single Post
Old 11-17-2012, 07:35 AM   PM User | #8
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,037
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by Old Pedant View Post
DOH on me! OF COURSE!

The whole reason his code didn't work was because he used document.form[0] instead of document.forms[0]!!!

Good eyes, Philip!
Follow Logic Ali's advice - use the error console!

Another good reason to use

var f = document.forms[0];

But as you say id is preferred

var f = document.getElementById("formid");
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote