[jQuery] Re: Manipulation of select objects
Nevermind. I got it to work. Thanks for the tips. They helped. On Jan 29, 6:20 pm, Josh Nathanson [EMAIL PROTECTED] wrote: Basically you can do this: $('select').each(function() { $(this).doWhatever() // will run the method doWhatever on the currently iterating select }); -- Josh - Original Message - From: RyanMC [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Tuesday, January 29, 2008 3:38 PM Subject: [jQuery] Manipulation of select objects I am working on a site where various dynamic content will be created each session. There will end up being between 1 and a very large number of select boxes on the page. Users are able to add items that need to be inserted into each select box. I found a plugin that allows me to addOption and adjust a select, but I can't seem to make it run through all select boxes on the page. I am quite new to jquery and any assistance would be very appreciated. Basically I need to know what selector to use to run through all selects. And if anyone is familiar with the addOption plugin and knows if it will work across multiple selects that would be fantastic too. If it won't anyone that can point me in the right direction to hand writing out the code for the select manipulation would be great. I will end up removing items from the select as well.
[jQuery] Re: Manipulation of select objects
I will give that a try thanks. On Jan 29, 6:20 pm, Josh Nathanson [EMAIL PROTECTED] wrote: Basically you can do this: $('select').each(function() { $(this).doWhatever() // will run the method doWhatever on the currently iterating select }); -- Josh - Original Message - From: RyanMC [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Tuesday, January 29, 2008 3:38 PM Subject: [jQuery] Manipulation of select objects I am working on a site where various dynamic content will be created each session. There will end up being between 1 and a very large number of select boxes on the page. Users are able to add items that need to be inserted into each select box. I found a plugin that allows me to addOption and adjust a select, but I can't seem to make it run through all select boxes on the page. I am quite new to jquery and any assistance would be very appreciated. Basically I need to know what selector to use to run through all selects. And if anyone is familiar with the addOption plugin and knows if it will work across multiple selects that would be fantastic too. If it won't anyone that can point me in the right direction to hand writing out the code for the select manipulation would be great. I will end up removing items from the select as well.
[jQuery] Re: Manipulation of select objects
Apparently the addOption() plugin doesn't like using $(this). I thought I had tried that loop before, that was the reason. I am sure there is a way to add and remove options without that plugin. Any pointers on where to start there? On Jan 29, 6:20 pm, Josh Nathanson [EMAIL PROTECTED] wrote: Basically you can do this: $('select').each(function() { $(this).doWhatever() // will run the method doWhatever on the currently iterating select }); -- Josh - Original Message - From: RyanMC [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Tuesday, January 29, 2008 3:38 PM Subject: [jQuery] Manipulation of select objects I am working on a site where various dynamic content will be created each session. There will end up being between 1 and a very large number of select boxes on the page. Users are able to add items that need to be inserted into each select box. I found a plugin that allows me to addOption and adjust a select, but I can't seem to make it run through all select boxes on the page. I am quite new to jquery and any assistance would be very appreciated. Basically I need to know what selector to use to run through all selects. And if anyone is familiar with the addOption plugin and knows if it will work across multiple selects that would be fantastic too. If it won't anyone that can point me in the right direction to hand writing out the code for the select manipulation would be great. I will end up removing items from the select as well.
[jQuery] Re: Manipulation of select objects
Basically you can do this: $('select').each(function() { $(this).doWhatever() // will run the method doWhatever on the currently iterating select }); -- Josh - Original Message - From: RyanMC [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Tuesday, January 29, 2008 3:38 PM Subject: [jQuery] Manipulation of select objects I am working on a site where various dynamic content will be created each session. There will end up being between 1 and a very large number of select boxes on the page. Users are able to add items that need to be inserted into each select box. I found a plugin that allows me to addOption and adjust a select, but I can't seem to make it run through all select boxes on the page. I am quite new to jquery and any assistance would be very appreciated. Basically I need to know what selector to use to run through all selects. And if anyone is familiar with the addOption plugin and knows if it will work across multiple selects that would be fantastic too. If it won't anyone that can point me in the right direction to hand writing out the code for the select manipulation would be great. I will end up removing items from the select as well.