|
-
Feb 8th, 2008, 11:39 AM
#1
[RESOLVED] document.getElementById vs document.forms
What is the difference between the two of these? I always assumed it was just a different way of getting the same object.
Now I find myself, more often than not, having to use document.forms to get values from items such as a radio button or a text area.
Could someone explain to me why this happens?
E.g) On a project I am working on, I have a textarea I want to validate.
document.getElementById("reason").value returns 'undefined'
document.forms[0].reason.value returns the actual value
Any feedback is appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|