Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

consult and doubt Javascript Best Practices number 5

 
Manuel Jordan
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic