IE 5.0: Object doesn't support property or method 
Author Message
 IE 5.0: Object doesn't support property or method

Anybody seen this error message on a SELECT list option assignment?
"Object
doesn't support property or method."  Here is a snippet of code that
works under
Netscape Navigator/Communicator and pre-5.0 versions of MS Internet
Explorer.  It
just stopped working for anyone who's "upgraded" to IE 5.0.

_____snip_____snip_____snip_____
    var i = 0;

    var retrievalField = frames[1].document.forms[0].chapter_users;
    var displayField = frames[0].document.forms[0].Chapter_member;

    displayField.options.length = 0;
    for (i = 0 ; i < retrievalField.length ; ++i)
    {
        displayField.options[i] = new
Option(retrievalField.options[i].text,
retrievalField.options[i].value);
        if (i == 0)
        {
            displayField.options[i].selected = true;
        }
    }
_____snip_____snip_____snip_____

For some odd reason, the JScript 5.0 interpreter in IE 5.0 doesn't like
the line
that says "displayField.options[i] = new Option(...)".  What's going on
here?  Why
can I no longer do something so simple as adding an option to a SELECT
box?




Fri, 21 Dec 2001 03:00:00 GMT  
 IE 5.0: Object doesn't support property or method
Have the same problem.

On Mon, 05 Jul 1999 17:29:21 -0600, Kevin Weller

Quote:

>Anybody seen this error message on a SELECT list option assignment?
>"Object
>doesn't support property or method."  Here is a snippet of code that
>works under
>Netscape Navigator/Communicator and pre-5.0 versions of MS Internet
>Explorer.  It
>just stopped working for anyone who's "upgraded" to IE 5.0.

>_____snip_____snip_____snip_____
>    var i = 0;

>    var retrievalField = frames[1].document.forms[0].chapter_users;
>    var displayField = frames[0].document.forms[0].Chapter_member;

>    displayField.options.length = 0;
>    for (i = 0 ; i < retrievalField.length ; ++i)
>    {
>        displayField.options[i] = new
>Option(retrievalField.options[i].text,
>retrievalField.options[i].value);
>        if (i == 0)
>        {
>            displayField.options[i].selected = true;
>        }
>    }
>_____snip_____snip_____snip_____

>For some odd reason, the JScript 5.0 interpreter in IE 5.0 doesn't like
>the line
>that says "displayField.options[i] = new Option(...)".  What's going on
>here?  Why
>can I no longer do something so simple as adding an option to a SELECT
>box?





Sat, 22 Dec 2001 03:00:00 GMT  
 IE 5.0: Object doesn't support property or method

(some of his text deleted...)

Quote:
> >the line
> >that says "displayField.options[i] = new Option(...)".  What's going on here?  Why can I no longer do something so simple as adding an
> option to a SELECT box?



'They' broke it!  

This is a {*filter*} bug!

But, there is a (complicated) workaround:

Replace EACH an EVERY  'new Option' in your Code with suitable code,
checking for MSIE 5

- loop from option.length down to zero and set the  .text  attribute to
"";
plus:  set the option object to 'null'.
(this clears the option box and resets its size)

- set the length to 1 and replace the visible part of the option box
with something suitable.

You could also use 'createobject' and 'deleteobject', but the above
method worked for me.



Thu, 27 Dec 2001 03:00:00 GMT  
 IE 5.0: Object doesn't support property or method
I got caught by this too.

The only benifit that I have is that I am working on IE only.

Anyhow this worked for me (IE 4 and IE 5)

  var index = parseInt(document.all.cboDateNeedDay.selectedIndex) ;
  var value = document.all.cboDateNeedDay[index].text;

For Netscape and IE you may have to have two pieces of code.  OUCH.  Welcome
to IE 5.

CSP


Quote:
> Anybody seen this error message on a SELECT list option assignment?
> "Object
> doesn't support property or method."  Here is a snippet of code that
> works under
> Netscape Navigator/Communicator and pre-5.0 versions of MS Internet
> Explorer.  It
> just stopped working for anyone who's "upgraded" to IE 5.0.

> _____snip_____snip_____snip_____
>     var i = 0;

>     var retrievalField = frames[1].document.forms[0].chapter_users;
>     var displayField = frames[0].document.forms[0].Chapter_member;

>     displayField.options.length = 0;
>     for (i = 0 ; i < retrievalField.length ; ++i)
>     {
>         displayField.options[i] = new
> Option(retrievalField.options[i].text,
> retrievalField.options[i].value);
>         if (i == 0)
>         {
>             displayField.options[i].selected = true;
>         }
>     }
> _____snip_____snip_____snip_____

> For some odd reason, the JScript 5.0 interpreter in IE 5.0 doesn't like
> the line
> that says "displayField.options[i] = new Option(...)".  What's going on
> here?  Why
> can I no longer do something so simple as adding an option to a SELECT
> box?





Fri, 28 Dec 2001 03:00:00 GMT  
 IE 5.0: Object doesn't support property or method
I still can't get it to work, could you give me an example for my code. I'm
adding the string 'str' to the end of SELECT box. What do i have to change
about this:

str = 'blablablablabla';
SelectTabel.options[SelectTabel.length] = new Option(str);

Could you also tell me how i could use createobject and deleteobject(i
couldn't find any syntax about the use of it).

Do you know if anyone has already adressed this problem to Microsoft and do
they supply a bugfix ?

Thanks in advance,

Bram Havers.


Quote:
> 'They' broke it!  

> This is a {*filter*} bug!

> But, there is a (complicated) workaround:

> Replace EACH an EVERY  'new Option' in your Code with suitable code,
> checking for MSIE 5

> - loop from option.length down to zero and set the  .text  attribute to
> "";
> plus:  set the option object to 'null'.
> (this clears the option box and resets its size)

> - set the length to 1 and replace the visible part of the option box
> with something suitable.

> You could also use 'createobject' and 'deleteobject', but the above
> method worked for me.



Sat, 29 Dec 2001 03:00:00 GMT  
 IE 5.0: Object doesn't support property or method

Quote:

>I still can't get it to work, could you give me an example for my code.

Hi there,

You can check the code that is on the link on this page:

http://www.netspace.net.au/~torrboy/code/jscriptfaq/hosts/browsers/an...
tml#a004

Peter

--

Please don't send questions to me personally - post to the groups
JScript FAQ: http://www.netspace.net.au/~torrboy/code/jscriptfaq/



Sun, 30 Dec 2001 03:00:00 GMT  
 IE 5.0: Object doesn't support property or method
Thanks Peter!  Unfortunately, my problem didn't have anything to do with the
frame reference syntax.  Rather, I needed to find out why I couldn't add an
option to an element in another frame in IE5 the way I'd always done in Netscape
and previous versions of IE.  And the envelope please....

As of JScript 5, one has to create any new options from within the same frame as
the SELECT field itself.  Get this: Microsoft considers this a feature!  If only
they had posted that little tidbit somewhere on their labyrinthine web site...
Oh well, I guess you have to consider the source. <shrug> <sigh>

Anyway, thanks for the pointers, and feel free to add this new information to
your FAQ.

Quote:


> >I still can't get it to work, could you give me an example for my code.

> Hi there,

> You can check the code that is on the link on this page:

> http://www.netspace.net.au/~torrboy/code/jscriptfaq/hosts/browsers/an...
> tml#a004

> Peter

> --

> Please don't send questions to me personally - post to the groups
> JScript FAQ: http://www.netspace.net.au/~torrboy/code/jscriptfaq/



Thu, 03 Jan 2002 03:00:00 GMT  
 IE 5.0: Object doesn't support property or method

Quote:
> Thanks Peter!  Unfortunately, my problem didn't have anything to do with
the
> frame reference syntax.  Rather, I needed to find out why I couldn't add
an
> option to an element in another frame in IE5 the way I'd always done in
Netscape
> and previous versions of IE.  And the envelope please....

It's the next one down! :-)

The link to #a004 should take you to the answer, but because it is at the
bottom of the page, and you can't scroll past the end of the page, the one
at the top of the page is the one about frames (depending on your window
size...)

Peter

--
Peter J. Torr - Microsoft Windows Script Program Manager

Please do not e-mail me with questions - post them to this
newsgroup instead. Thankyou!



Fri, 01 Feb 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Object doesn't support this property or method : 'DTSGlobalVariables(...).Value.Open

2. Object doesn't support this property or method

3. Object doesn't support this property/method??????

4. Object doesn't support this property or method

5. Object doesn't support this property or method

6. Object doesn't support this property or method

7. Sample code: Object doesn't support this property or method

8. Object doesn't support this property or method

9. Object doesn't support this property or method

10. ASP Error on Session.Contents : Object doesn't support this property or method

11. Object doesn't support this property or method

12. Help!- 438- Object doesn't support this property or method

 

 
Powered by phpBB® Forum Software