View Single Post
Old 11-18-2012, 09:28 AM   PM User | #11
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,103
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by felgall View Post
My suggestion was made on the basis of not amending the HTML for the current form. Using an id for accessing the form from JavaScript is certainly the better option.

Where you have an id on any field within the form you don't need one on the form tag itself as any field within the form provides easy access to the entire form.
Very true, but if the form is to be submitted to a server-side script then the form elements must have names (in addition to ids if present). Like Old Pedant I see no real need to assign ids to form elements.
__________________

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