DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   input id and name issue (http://www.daniweb.com/forums/thread33370.html)

Sailor_Jerry Oct 4th, 2005 3:52 pm
input id and name issue
 
has anyone ran into this before?

The id and name had a capital letter. “submitButton� “submitButton�
<input id="submitButton" name=" submitButton " value="ok" 
type="button" title="submit" onclick="submitButton();" />
For some reason I would see the following js error: object doesn't support this property or method. When I clicked the button.

When I changed the id and name to all lowercase "submitbutton" everything works fine.

tgreer Oct 4th, 2005 4:24 pm
Re: input id and name issue
 
Probably due to having elements, JavaScript functions, etc. all with the same name. That's just a guess.

Sailor_Jerry Oct 5th, 2005 11:48 am
Re: input id and name issue
 
Good stuff.

"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.

This is Internet Explorer's fault, because submitButton shouldn't be a global variable." (Slime)

tgreer Oct 5th, 2005 12:00 pm
Re: input id and name issue
 
Good guess. Where did you get that little piece of information? Please post the link for the benefit of future readers.


All times are GMT -4. The time now is 3:41 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC