HighDots Forums  

document.getElementById(tagName) has no properties

alt.html.dhtml alt.html.dhtml


Discuss document.getElementById(tagName) has no properties in the alt.html.dhtml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Michaels
 
Posts: n/a

Default document.getElementById(tagName) has no properties - 06-30-2007 , 08:30 PM






I need to set the value of an <input> tag. how do I do it
cross-browser? FF won't let me. and it sits there with documented
functions like setAttribute() and getElementById()
and all it does is spit out error messages.

document.getElementById(tagName).setAttribute('val ue', val);


I can, however, do this for reading a value:
document.getElementById(tagName).value;

*sometimes*. sometimes it works for reading a value, and sometimes it
doesn't - like when I am using it in certain functions.

FF seems flaky to me. I don't know what's going on. I need help.
--

------------------------------------
Jim Michaels
for email, edit the address

RAM Disk is *not* an installation method.

Reply With Quote
  #2  
Old   
Jim Michaels
 
Posts: n/a

Default Re: document.getElementById(tagName) has no properties - 06-30-2007 , 10:15 PM






Jim Michaels wrote:
Quote:
I need to set the value of an <input> tag. how do I do it
cross-browser? FF won't let me. and it sits there with documented
functions like setAttribute() and getElementById()
and all it does is spit out error messages.

document.getElementById(tagName).setAttribute('val ue', val);


I can, however, do this for reading a value:
document.getElementById(tagName).value;

*sometimes*. sometimes it works for reading a value, and sometimes it
doesn't - like when I am using it in certain functions.

FF seems flaky to me. I don't know what's going on. I need help.

never mind. found the problem. id of the element wasn't defined. only
the name was. works in IE. interesting?

however, I fif find out that getAttribute() doesn't work in FF.
setAttribute() does.

--

------------------------------------
Jim Michaels
for email, edit the address

RAM Disk is *not* an installation method.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.