That's an IE bug, actually.

There's been a number of threads about this issue and we ended up
deciding against supporting this (for performance reasons).

Please search the core mailing list for more info on this.

Best,

Tobie

On Nov 11, 11:41 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> It's not a bug, "[Object]" is the correct answer in both places.
> (Well...correct by IE standards; in fact, you don't have an element
> with the ID 'sex' and so it should be returning null, but IE pretends
> names are IDs in some situations.)
>
> It's all in the name, really:  "get *element* by ID" -- not get
> element *value*, get *element*.  If you want the value, you get that
> from the element.  Prototype can help with 
> that:http://www.prototypejs.org/api/utility/dollar-f
> ...but you'll need to give the select box an ID.  Currently it has a
> name, which is a different thing entirely (unless you're using IE).
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 11, 9:16 am, btpka3 <[EMAIL PROTECTED]> wrote:
>
> > IE version : 6.0.29000.5512.xpsp_sp3_gdr.080814-1236
>
> > What do you think is showed on IE alert window with following code ???
> > Both are "[Object]" !!!
>
> > If you think to fix it is necessary, Hope you to update  prototype.js,
> >  or tell the author to update!
> > Thanks!
>
> > <html>
> > <head>
> > <script src="prototype-1.6.0.2.js" language="JavaScript" type="text/
> > javascript" ></script>
> > <script>
> > /*
> > if (/msie/i.test (navigator.userAgent)){
> >     document.nativeGetElementById = document.getElementById;
> >     document.getElementById = function(id){
> >         var elem = document.nativeGetElementById(id);
> >         if(elem){
> >             if(elem.attributes['id'].value == id){
> >                 return elem;
> >             }else{
> >                 for(var i=1;i<document.all[id].length;i++){
> >                     if(document.all[id][i].attributes['id'].value ==
> > id) {
> >                         return document.all[id][i];
> >                     }
> >                 }
> >             }
> >         }
> >         return null;
> >     };}*/
>
> > function load(){
> >         var ele = null;
> >         ele = document.getElementById("sex");
> >         alert(ele);
> >         ele = null;
> >         ele = $("sex");
> >         alert(ele);}
>
> > </script>
> > </head>
> > <body onload="load()">
> >         <select name="sex">
> >                         <option value="0">boy</option>
> >                         <option value="1">gril</option>
> >         </select>
>
> > </body>
> > </html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to