tCheckAll

A simple way to select all your checkboxes

View the Project on GitHub berumen/tCheckAll

tCheckAll, What is this?

tCheckAll is a jquery plugin that allows you to check or uncheck all your checkboxes.
It was built using the jQuery library.

Author

Copyright (c) 2023 Alfredo Berumen Saldivar
http://berumen.xyz
@berumen

How to use

Include tCheckAll plugin in your website directory then load files in the
section of your HTML document. Don't forget to add the jQuery library (v >= 1.12.4)


<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.3.min.js"></script>
<script type="text/javascript" src="jquery.tcheckall.min.js"></script>

Just put your 'Check All' link, button or any clickable element identified by an id inside a fieldset tag, use whatever name you wish for the id. For example:


<form id="my_id">
<fieldset>
<legend>Select</legend>
<a href="javascript:void(0)" id="all"> Select All</a><br />
<input type="checkbox" name="my_name[]" value="1" />1<br />
<input type="checkbox" name="my_name[]" value="2" />2<br />
<input type="checkbox" name="my_name[]" value="3" />3<br />
<input type="checkbox" name="my_name[]" value="4" />4<br />
<input type="checkbox" name="my_name[]" value="5" />5<br />
</fieldset>
</form>

Trigger the plugin using the following code:


$(document).ready(function() {
  $('#all').tCheckAll();      
});

You can use the following custom events and add your own code


    $(document).ready(function() {
    	$('#myCheck').tCheckAll({
            checkTxt: 'Check',
            unckeckTxt: 'Uncheck',
            cheked: true,
        });

        $('#myNewCheck').tCheckAll({
            cheked: true,
        });
    });

Example

For a live demonstration visit: tCheckAll demo
Or visit the official web page: Official site

License

Licensed under MIT license

Bug tracker

Have a bug? Please create an issue on GitHub at issues