[jQuery] Re: Select all items in list on form submit
Thank you both for all your input changing to a click event on the button seems to have worked. I must have done something different this time as I tried that before posting here. Anyway thanks guys. On Jan 15, 1:17 pm, Amos King wrote: > Try tying in to the click event of the submit instead of the submit event. > Just make sure to return false so the submit doesn't go off. > > On Fri, Jan 15, 2010 at 5:12 AM, Richard McKenna < > > > > > > richardofmcke...@googlemail.com> wrote: > > So here's the full example. What it should do is select all the items > > that have been moved to the right hand side, then submit the form. > > >http://67.199.29.196/selecttest.cfm > > > On Jan 14, 9:27 pm, pedalpete wrote: > > > Can you give a bit more detail? > > > > Is the submit not firing? or the .each? > > > > I always like to give my selectors an element+class/id, apparently it > > > is more efficient, and I have noticed that some browses (it seems only > > > sometimes) will miss some elements when only using the id/class. > > > > But throw some alerts in there so you can see what is not firing, and > > > then we can go from there. > > -- > Amos Kinghttp://dirtyInformation.comhttp://github.com/Adkron > -- > Looking for something to do? Visithttp://ImThere.com
Re: [jQuery] Re: Select all items in list on form submit
Try tying in to the click event of the submit instead of the submit event. Just make sure to return false so the submit doesn't go off. On Fri, Jan 15, 2010 at 5:12 AM, Richard McKenna < richardofmcke...@googlemail.com> wrote: > So here's the full example. What it should do is select all the items > that have been moved to the right hand side, then submit the form. > > http://67.199.29.196/selecttest.cfm > > > On Jan 14, 9:27 pm, pedalpete wrote: > > Can you give a bit more detail? > > > > Is the submit not firing? or the .each? > > > > I always like to give my selectors an element+class/id, apparently it > > is more efficient, and I have noticed that some browses (it seems only > > sometimes) will miss some elements when only using the id/class. > > > > But throw some alerts in there so you can see what is not firing, and > > then we can go from there. > -- Amos King http://dirtyInformation.com http://github.com/Adkron -- Looking for something to do? Visit http://ImThere.com
[jQuery] Re: Select all items in list on form submit
So here's the full example. What it should do is select all the items that have been moved to the right hand side, then submit the form. http://67.199.29.196/selecttest.cfm On Jan 14, 9:27 pm, pedalpete wrote: > Can you give a bit more detail? > > Is the submit not firing? or the .each? > > I always like to give my selectors an element+class/id, apparently it > is more efficient, and I have noticed that some browses (it seems only > sometimes) will miss some elements when only using the id/class. > > But throw some alerts in there so you can see what is not firing, and > then we can go from there.
[jQuery] Re: Select all items in list on form submit
Thanks very much for your reply. OK following your advice I tried the following $('form#assignUsersForm').submit(function() { alert("submit fired"); $('select#assignedUserList option').each(function(i) { alert("each fired"); $(this).attr("selected", "selected"); }); }); Added the elements form & select selectors and the alerts. All works as it should in FF and others but still not in IE7 & 6 the submit function isn't getting fired so the each never gets a chance. Ill put together a working example so you can see the full thing. Thanks, Richard On Jan 14, 9:27 pm, pedalpete wrote: > Can you give a bit more detail? > > Is the submit not firing? or the .each? > > I always like to give my selectors an element+class/id, apparently it > is more efficient, and I have noticed that some browses (it seems only > sometimes) will miss some elements when only using the id/class. > > But throw some alerts in there so you can see what is not firing, and > then we can go from there.
[jQuery] Re: Select all items in list on form submit
Can you give a bit more detail? Is the submit not firing? or the .each? I always like to give my selectors an element+class/id, apparently it is more efficient, and I have noticed that some browses (it seems only sometimes) will miss some elements when only using the id/class. But throw some alerts in there so you can see what is not firing, and then we can go from there.