[jQuery] Re: TexoTela select box manipulation modification

2008-01-17 Thread codecowboy
I don't know if you are familiar with frameworks like RoR or CakePHP, but they have classes called helpers. Both frameworks have a prototype/scriptaculous helper built in to them. I wanted to build a helper for manipulating select boxes on top of your jquery plugin. The moveOptions function is c

[jQuery] Re: TexoTela select box manipulation modification

2008-01-17 Thread codecowboy
Hi Sam, Will you add add that move function to your plugin? The reason I ask is so that I don't have to use my own version of the plugin. Thank you, CodeCowboy On Jan 17, 11:47 am, Sam Collett <[EMAIL PROTECTED]> wrote: > I think it may be because when you remove an option the total number >

[jQuery] Re: TexoTela select box manipulation modification

2008-01-17 Thread Sam Collett
I think it may be because when you remove an option the total number of options is decreased, so you never get through all of them. Start at the last option and then go back, so instead of: for(var i = 0; i0; i--) On Jan 17, 3:44 pm, codecowboy <[EMAIL PROTECTED]> wrote: > Thank you very much.

[jQuery] Re: TexoTela select box manipulation modification

2008-01-17 Thread codecowboy
Thank you very much. That worked. It would be great if you had the time to tell me what was wrong with my original code because JS is something that i am not so familiar with. On Jan 17, 7:25 am, Sam Collett <[EMAIL PROTECTED]> wrote: > This should work: > > $.fn.moveOptions = function(to, whic

[jQuery] Re: TexoTela select box manipulation modification

2008-01-17 Thread Sam Collett
This should work: $.fn.moveOptions = function(to, which) { this.copyOptions(to, which); if(which == "all") { this.find("option").remove().end(); } else { this.find("[EMAIL PROTECTED]").remove().end(); } return this; } On Jan 16, 11:03 pm, codecowbo