[jQuery] Re: Urgent: Can't use attr(selected, true) on option in IE6

2007-07-06 Thread benjaah
Hi - I'm experiencing the same problem with IE6 where I get an error Could not set the selected property. Unspecified error when executing the code: $(option:first, #my_select).attr(selected,true); OR $(option:first, #my_select).attr(selected,selected); OR $(#my_select).children([EMAIL

[jQuery] Re: Urgent: Can't use attr(selected, true) on option in IE6

2007-05-24 Thread [EMAIL PROTECTED]
my code looks like this: for(var i=0; i$(#smsUserPrice).children().size(); i++){ curSmsOption = $(#smsUserPrice).find(option:eq(+i+)); if($(curSmsOption).attr(value) ==

[jQuery] Re: Urgent: Can't use attr(selected, true) on option in IE6

2007-05-24 Thread Rob Desbois
Just as an aside, related to a recent thread entitled 'Performance tip' ( http://groups.google.com/group/jquery-en/browse_thread/thread/15a11a44b29c27b2/d8bfffd73b4ebb9f#d8bfffd73b4ebb9f) please, please, please for everyone's sanity don't do $(...).children().size() in the body of a for loop,

[jQuery] Re: Urgent: Can't use attr(selected, true) on option in IE6

2007-05-24 Thread Karl Swedberg
Hi Jakob, Instead of: $(curSmsOption).attr(selected, true); try: $(curSmsOption).attr(selected, selected); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 24, 2007, at 8:00 AM, [EMAIL PROTECTED] wrote: for(var i=0;

[jQuery] Re: Urgent: Can't use attr(selected, true) on option in IE6

2007-05-24 Thread Rob Desbois
Oh yes, sorry I forgot the ); after the function passed to $.each(). Corrected (and tested!) version is below: function test() { $(#smsUserPrice option).each(function() { // $(this) is the current option element var value = $(this).val(); if (value == z)

[jQuery] Re: Urgent: Can't use attr(selected, true) on option in IE6

2007-05-24 Thread RobG
On May 25, 1:29 am, Rob Desbois [EMAIL PROTECTED] wrote: Oh yes, sorry I forgot the ); after the function passed to $.each(). Corrected (and tested!) version is below: It seems to me that the only jQuery function necessary is .each, subsequent use of $ is unnecessary. If the intention is to