MorningZ,

That works a real treat! Thank you very much indeed!!!

One thing further I'd like to pick your brains on. I have a 'select
all' script which works like this:

        $(".select_all_cm").click(function() {
                var checked_status = this.checked;
                $("input[name=CMStudent_IDs]").each(function()
                {
                    this.checked = checked_status;
                });
         });

However, using this doesn't trigger the change() event on the
checkboxes, is there another event we can bind to that function
that'll be triggers by the select_all as well?

Thanks mate,

Rob

On Mar 5, 3:32 pm, MorningZ <morni...@gmail.com> wrote:
> Here's a quick example i whipped up (and works)
>
> http://paste.pocoo.org/show/106586/
>
> To note about your code, "setAttr" isn't a jQuery call, it's ".attr"
>
> On Mar 5, 10:04 am, Sir Rawlins <robert.rawl...@thinkbluemedia.co.uk>
> wrote:
>
> > Hey Ryan!
>
> > Thanks for your advice, I appreciate it.
>
> > I've got this now:
>
> > <input type="checkbox" name="CMStudent_IDs" value="s...@email.com" /></
> > td>
> >         <a class="blue_button" id="mail"><span>Email Selected Students</
> > span></a>
>
> >             $("input[name='CMStudent_IDs']").click(function(){
> >                                 var mylink = [];
>
> >                                 
> > $("input[name='CMStudent_IDs':checked]").each(function(i){
> >                                      mylink.push($(this).val());
> >                                 });
>
> >                                 $("a#mail").setAttr("href", "mailto:"; + 
> > mylink.join
> > (","));
> >             });
>
> > However it doesn't seem to work for me, I check a couple of the
> > checkboxes but the link is never given an href so clicking it does
> > nothing. Can you spot anything out of sorts with the code?
>
> > Many thanks mate,
>
> > Rob
>
> > On Mar 5, 1:34 pm, "ryan.j" <ryan.joyce...@googlemail.com> wrote:
>
> > > and you'd probably want to add :checked onto the end of the selector
> > > too. ;)

Reply via email to