This sample code checks and unchecks all choices of a checkbox field.
Sample Image
Sample Code
Notes
Make sure to match the Field code your fields, with the Field code written in the code.
Refer to the Tutorial page, on how to add scripts to your app.