Closed Thread Icon

Topic awaiting preservation: Mozilla & DOM (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8215" title="Pages that link to Topic awaiting preservation: Mozilla &amp;amp; DOM (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Mozilla &amp; DOM <span class="small">(Page 1 of 1)</span>\

 
hlaford
Bipolar (III) Inmate

From: USA! USA! USA!
Insane since: Oct 2001

posted posted 06-19-2002 22:30

I noticed the other day that Mozilla will return the value from HTML source for the 'type' attribute on the textbox form element object.

<input type="TEXTBOX" ... />

IE will actually return 'text' on this element, whereas Moz/NN returns 'TEXTBOX'. Is this W3C standard behavior or is it a bug? Moz obviously knows it's a textbox since it displays one on-screen, but I find its choice of return values worrisome.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-19-2002 22:53

umm...

I may be totally wrong here but I think they are kinda both right. The issue I see is that I don't think "textbox" is actually a valid input type I believe it's supposed to be "text". (they're called textbox's but for input field type attributes I think it's just "text")



.:[ Be Bert. Be Ernie. Just be. ]:.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-19-2002 22:53

The standard DOM way to get an attribute is with the getAttribute function:

document.getElementById('idOfTheInput').getAttribute('type');

By the W3C's DOM, I'm *pretty* sure that the 'type' attribute should actually be undefined.

[edit: Bitdamaged is right, you want "text" instead of "textbox" anyway. Both IE and Moz are being nice to you; it's just that IE is being nice and forgetting it was nice, and Moz is being nice and not forgetting it was nice.]

[This message has been edited by Slime (edited 06-19-2002).]

hlaford
Bipolar (III) Inmate

From: USA! USA! USA!
Insane since: Oct 2001

posted posted 06-20-2002 15:38

The type attribute is defined in the DOM as
<BLOCKQUOTE><FONT face="Verdana, Arial">quote:</font><HR>type = text

« BackwardsOnwards »

Show Forum Drop Down Menu