TimeTraveler
IS-IT--Management
I'm building this filter for an event lister. My idea is to do it client side with JavaScript hiding and showing div tags labels by two-letter state code. It was such a simple idea... Of course, I get hung up on handling objects and methods, as usual.
Thanks in advance to anyone who can tell why I'm getting an error on getElementById and why this won't go. I get the following error in IE regarding the line with getElementById:
Somehow, I'm missing how to get the contents of all the elements of st[] into the getElementByID.
Sean aka TimeTraveler![[rockband] [rockband] [rockband]](/data/assets/smilies/rockband.gif)
Visit
Thanks in advance to anyone who can tell why I'm getting an error on getElementById and why this won't go. I get the following error in IE regarding the line with getElementById:
Error: Object doesn't support this property or method.
Code:
<SCRIPT type=text/javascript>
st = new Array(
"AK", "AL", "AR", "AZ", "CA",
"CO", "CT", "DC", "DE", "FL",
"GA", "HI", "IA", "ID", "IL",
"IN", "KS", "KY", "LA", "MA",
"MD", "ME", "MI", "MN", "MO",
"MS", "MT", "NC", "ND", "NE",
"NH", "NJ", "NM", "NV", "NY",
"OH", "OK", "OR", "PA", "PR", "RI",
"SC", "SD", "TN", "TX", "UT",
"VA", "VT", "WA", "WI", "WV", "WY");
function hideAllStates() {
for(i = 0; i<st.length; i++) {
document.getElementByID(st[i]).style.display = "none";
}
}
</SCRIPT>
Somehow, I'm missing how to get the contents of all the elements of st[] into the getElementByID.
Sean aka TimeTraveler
![[rockband] [rockband] [rockband]](/data/assets/smilies/rockband.gif)
Visit