• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

consult and doubt Javascript Best Practices number 5

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys
(sorry for my grammar)

The motive of this is a consult, i dont have a high knowledge about js, only the necessary

i saw this link http://www.javascripttoolbox.com/bestpractices/ number 5

the doubt and consult is the next
when i have a simple "form" with N fields and the "form" declared in this way


where the method ValidationForm() is defined and included how an external file like

i saw in the mentionated link the suggestion 5 "Reference Forms and Form Elements Correctly"

so i apply now in my code the mentioaned suggestion


my really doubt is when i should use getElementById("someid") and
formElements["namefield"] like the way mentionated

maybe the question is silly, but i saw in others pages of the Web that not use
the way suggested (use or work with my wrong way), so i am confused

but i know by a good reference that is necessary and is a good practice
and maybe a rule of gold work with getElementById
(see http://www.mozilla.org/docs/web-developer/upgrade_2.html )
to access an element in a html page

so which and when i should use the suggested way and getElementById

i am not an expert in javascript

please help to resolve my doubt

thanks so much for advanced
[ November 10, 2006: Message edited by: Manuel Jordan ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic