aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes consult and doubt Javascript Best Practices number 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "consult and doubt Javascript Best Practices number 5" Watch "consult and doubt Javascript Best Practices number 5" New topic
Author

consult and doubt Javascript Best Practices number 5

Manuel Jordan
Ranch Hand

Joined: Sep 29, 2006
Posts: 131
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 ]

kill your pride, share your knowledge with all
 
 
subject: consult and doubt Javascript Best Practices number 5