Results 1 to 4 of 4

Thread: 'Select all' on checkbox inputs

  1. #1
    User
    Join Date
    04-10-11.
    Posts
    162

    Default 'Select all' on checkbox inputs

    Is it possible to add a 'Select all' box to a DCA checkbox field that is displayed in the frontend?

    Specifically I'm talking about the registration module, that uses the tl_member DCA. I've added some checkboxes to this, but as there are quite a few I need a 'Select all' box that will save the user from having to potentially click a lot of checkboxes.

    I know I could just include a 'Select all' option for my checkboxes, but I don't want it to be an actual option.

    Thank you

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: 'Select all' on checkbox inputs

    I would probably use a JavaScript solution for this. You could add a button/link/checkbox this way, and then loop through and check all the other boxes when it's clicked. So in other words, not really using Contao at all but just a little MooTools/jQuery snippet.
    Brian

  3. #3
    New user qzminski's Avatar
    Join Date
    01-08-13.
    Location
    Poland
    Posts
    24

    Default Re: 'Select all' on checkbox inputs

    Yup, I think so, too. There are probably tutorials over the net.
    Contao ambassador
    Codefog - Contao web development

  4. #4
    User
    Join Date
    04-10-11.
    Posts
    162

    Default Re: 'Select all' on checkbox inputs

    Thanks for the suggestions. I also arrived at the same solution. In the end I injected the extra checkbox option using jQuery, then set on click event that checked or unchecked all the other boxes in the fieldset.

    I just wanted to make sure there was no other way of doing this by manipulating the DCA or something.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •