It only took like five minutes to switch to using .append(). In the beginning it's how I would have done it to begin with.

However, the plug-in is here: http://sam.collett.googlepages.com/addOption.html and I've already written code that breaks it.

<html>
   <head>
       <title>Select Test Page</title>
       <script type="text/javascript" src="/include/js/jquery.js"></script>
       <script>
           var a = new Array;
           a[0] = "jQuery";
           a[1] = "really";
           a[2] = "rocks!";
function PopulateSelect(){
               for(var i = 0; i < a.length; i++){
                   $("#MySelectID").addOption(a[i], a[i], false);
               }
           }
       </script>
   </head>
<body>
   <select id="MySelectID" name="MySelect"></select>
   <input type="button" value=" Populate " onclick="PopulateSelect();">
   </body>
</html>

I hadn't gotten the chance to post it on my personal site so folks could look at it, but now I'm not sure there's a need. It'd be nice if the plug-in worked too, but like you said, don't push code that you don't need down to the browser. :o)

I think I'm using the plug-in in one or two more areas, but those pages have not been upgraded to jq1.1 just yet. :o)

Thanks,
Chris

Brandon Aaron wrote:
On 1/9/07, Christopher Jordan <[EMAIL PROTECTED]> wrote:
 Hmm... It might be trivial, but that means I have to write code that will
decide if an option is selected or not rather than passing a boolean.

 I used to be able to do this:
 $("##Classification_ID").addOption("myValue",
"myOptionDisplay", (a[i].toUpperCase() == "RN"));

 The last bit would evaluate to a true or false, and either select the
option or not. It's was a handy shortcut. Well, I'll overcome it.

 Jörn: I was able to get a small sample to break, but since it appears that
what the dev folks want is for us to .append and .prepend, I'll do that.
Whatever is faster. :o)

No, I just wanted to make sure you knew it was possible to do without
the plugin. I would encourage you to make it as simple on yourself as
possible. If you are already using the plugin, I wouldn't drop it.
Sometimes, bug fixes like the select element get overlooked and I just
wanted to try and spread the word. :)

If you could post a link to the actual plugin, I can setup a simple
test case and see if we can find the issue.

--
Brandon Aaron

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


--
http://www.cjordan.info

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to