This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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

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 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 ]

kill your pride, share your knowledge with all
I agree. Here's the link:
subject: consult and doubt Javascript Best Practices number 5
jQuery in Action, 3rd edition