I have a function that uses getElementById and it has been working great. Now I have a page where I call it more than once on the page. The first one works but the rest don't. What do I need to do to make multiples work on one page?
I have a function that uses getElementById and it has been working great. Now I have a page where I call it more than once on the page. The first one works but the rest don't. What do I need to do to make multiples work on one page?
Usually the problem you've described is with the Elements ID values..
e.g.. getElementById('element_A') and getElementById('element_B') refer to elements id="element_A" and id="element_B"
all of the elements on your page are automatically assigned and element id by order UNLESS you have specified their Element ID, so each element MUST have a unique ID.. Chances are your page has multiple elements specified with the same ID.
Generally JavaScript uses the elements ID and PHP and POST use the element NAME..
Generally the convention is to have the Element ID and Name the same but unique to all other elements on your page...
Hope that helps...