• Hi,

    Is it possible to select all checkboxes in a form? I need some kind of combination of [acceptance accept-this invert default:on] and the regular checkbox code.

    So all chekcboxes need to be preselected on website: https://www.aanbetalingkeuken.nl/gratis-keukenbrochures/

    If this is not possible, is there an option to select all checkboxes in one time?

    Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • I’m struggling with the similar problem, found this solution: https://jsfiddle.net/w3gQJ/474/. And it works for me, checks all the checkboxes, all good.
    BUT
    For some reason even if the acceptance checkboxes are checked using this, the submit button is still inactive.

    Any ideas?

    Thread Starter hilvie

    (@hilvie)

    Where can i fill in the fields you used?

    Emm I’m not sure what you mean?

    The link I sent, has a mechanism that checks all the unchecked boxes. Just paste it within <script> tag at the bottom of your form. You might hit a bump though with jquery, here’s what my code looks like

    <script type="application/javascript">
    jQuery(document).ready(function($) {
    	$("#checkAll").click(function() {
    		$('input:checkbox').not(this).prop('checked', this.checked);
    	});
    });
    </script>
    Thread Starter hilvie

    (@hilvie)

    I used the script above and <input type=”checkbox” id=”checkAll”>Check all
    <hr />

    Now everything can be checked and works fine. Form also submits. Thank you!

    Does this also work with your form?

    Do you know a way that people will be redirected to the buttomside of the form when clicking on ‘check all’? Redirect to a popup is also good.

    Nope, I’m using acceptance checkboxes, and for me even though they’re checked, the button does not become active :/

    As for scrolling, you could use scrollTop from jQuery just add another line below the checkbox checking function, so there are 2 things happening on the same click.

    Thread Starter hilvie

    (@hilvie)

    That’s strange. I can’t help you with that. Don’t have enough knowledge for that…

    Thank you so much. Hope we can make that work also ?? All the best for you!

    Out of curiosity: are you using acceptance or standard select boxes?

    Thread Starter hilvie

    (@hilvie)

    The standard select boxes.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Select all checkboxes in a form’ is closed to new replies.