Topic awaiting preservation: Input Object Issue |
|
---|---|
Author | Thread |
Obsessive-Compulsive (I) Inmate From: |
posted 10-04-2005 22:16
Has anyone ran into this problem? code: <input id="submitButton" name=" submitButton " value="ok" type="button" title="submit" onclick="submitButton();" />
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 10-04-2005 23:42
Internet Explorer incorrectly adds all name's (and maybe id's) of objects as global variables. So when you say submitButton(), it thinks you're trying to call the <input> tag itself as a function. Renaming the tag (javascript is case sensitive) prevented this. |
Obsessive-Compulsive (I) Inmate From: |
posted 10-05-2005 17:44
ahhhh i see... this is a good thing to know. |
Bipolar (III) Inmate From: Sweden |
posted 10-06-2005 16:29
quote:
|
Paranoid (IV) Inmate From: schillmania.com |
posted 10-09-2005 19:16
Use document.getElementById() wherever possible, and avoid using name attribute values like "map" and other values that may be reserved keywords by script or the browser. |
Bipolar (III) Inmate From: Sweden |
posted 10-09-2005 19:41
I love the document.getElementById() method but I tend to mistype it or forget document. code: function getId(id){ return document.getElementById(id) }
|