Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

consult and doubt Javascript Best Practices number 5  RSS feed

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 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 )
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
Boost this thread!