Re: Accessing Form attributes instead of elements

Thomas Fuchs
Mon, 24 Sep 2007 07:33:53 -0000

Seems that these are bugs. Can you whip up some failing unit tests
for this?

best,
thomas

Am 24.09.2007 um 05:12 schrieb RobG:

>
>
>
> On Sep 22, 6:55 pm, Thomas Fuchs
<tho...-9D208sng4xU@public.gmane.org> wrote:
>> Consider using Prototype''s readAttribute method instead. It
>> automatically deals with cross-browser stupidities
>
> readAttribute has its problems too.  Where an attribute value is
> expected to be a string and has not been specified at all, IE returns
> an empty string, other browsers return null.  So in IE you can''t
tell
> whether the attribute was not specified (which should return null), or
> was specified and not given a value (which should return an empty
> string).
>
> As far as I know, the only way to fix that in IE is to parse the
> element''s HTML to determine the correct response.
>
> Also, when using readAttribute with the checked attribute and it has
> been set, IE returns ''checked'', Firefox returns an empty
string.
>
> So there are quite a few foibles that readAttribute does not deal
> with.
>
>
> --
> Rob
>
>
> >