Is there a way in Confluence to create a checkbox without it being a task?
Asked by Ronald Yeshulas:

I would like to create a checklist on a confluence page, but the list is not a list of tasks. I have looked at the checklist plug-in, but don't want to create a page for each item on the list (could be as large as 20 or 30 items). Anyone have any ideas?


Answers:
author: Davin Studer
body: How about something like this? Just put a comma separated list in the macro body.

**Macro Name:**   
dynamic_checkboxes

**Macro Title:**   
Dynamic Checkboxes  

**Description:**   
This will create dynamic checkboxes from a comma separated list.

**Macro Body Processing:**   
Escaped

**Template:**

```
## Developed by: Davin Studer## Date created: 12/2/2014## @noparams#set ($containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager'))#set ($getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null))#set ($containerManager=$getInstanceMethod.invoke(null,null))#set ($containerContext=$containerManager.containerContext)#set ($contentPropertyManager=$containerContext.getComponent('contentPropertyManager'))#set ($d = '$')#if($req.getParameter('submit') == "true" && $req.getParameter('checkbox') && $req.getParameter('checkbox') != "")    #if($req.getParameter('value') && $req.getParameter('value') != "")        #set ($value = $req.getParameter('value'))    #else        #set ($value = "")    #end    $contentPropertyManager.setStringProperty($content, $req.getParameter('checkbox'), $value)#end?#if ($body != "")    <form class="aui" id="dynCheckboxForm">    #foreach($box in $body.split(","))        #if($contentPropertyManager.getStringProperty($content, "dynCheckbox$box") == "checked")            #set($checked = 'checked="checked"')        #else            #set($checked = '')        #end        <div class="checkbox">            <input class="checkbox dynCheckbox" type="checkbox" name="dynCheckbox$box" id="dynCheckbox$box" $checked value="checked" />            <label for="dynCheckbox$box">$box</label>        </div>      #end    </form>#end<script type="text/javascript">AJS.toInit(function(){    AJS.$('.dynCheckbox').click(function(){        AJS.${d}.ajax({            type: 'GET',			data: {                submit: 'true',                checkbox: AJS.$(this).attr('id'),                value: AJS.$(this).is(':checked') ? 'checked' : ''            },			url: "$content.getUrlPath()",			success: function(data) {			},			error: function() {			}        });    });});</script>
```

comments: author: Ronald Yeshulas
body: I guess I hit my limit for comments yesterday, so had to wait until today to say thanks. This is exactly what I needed.


author: Davin Studer
body: Glad it works.


author: Todd Hank
body: This is Fansastic! Thank you


author: Mike Muekni
body: This is a fantastic macro but it doesn't save the checked state for me. Is there any way to do it?


author: Alex Christie
body: Hello Davin, you're an absolute legend for sharing this! The code doesn't seem to work for me. I pasted the code and entered the corresponding title,name and macro body processing.

When I insert the macro i get this error

"Error rendering macro 'dynamic_checkboxes' : Error occurred rendering template content"

Any ideas? I'm on confluence server 6.4.0


author: Davin Studer
body: That is because when Atlassian migrated this forus from their previous site they messed up code blocks. So, all the html is now escaped out. Copy the code and do a find a replace on these in this order ...

|----------|-------------|
| **Find** | **Replace** |
| \&amp;   | \&          |
| \&lt;    | \<          |
| \&gt;    | \>          |


author: Eitan yomtovian
body: If I have Conflunce-cloud, where do I write this code?


author: Davin Studer
body: There is no way to do this with the cloud version as you cannot write user macros.


author: Meredith B
body: Hi Davin,

Are you still able to answer questions about this?

I'd like to share a page I'm creating with our staff. It has a checklist to refer to in it. However, if I use the built in formatting, everything is automatically considered a Task. Almost none of our staff have edit rights to pages, so they can't tick anything off.

Your code up there works perfectly to create non-Task checkboxes, so thank you very much for sharing it!

However, I can't use it, because Confluence remembers what's checked between sessions. Is there a way that I can set it up so that if the page is refreshed, all the check boxes are cleared?

Thanks very much in advance.


author: Robert Ortner
body: Just enter \[\] without blanks - automaticly converted to a checkbox. Very usefull in tables instead of using yes/no or similar stuff

comments: author: Vicki Lea Tsang
body: Awesome! Thanks Rob!


author: UNSW Global IT
body: Brilliant


author: Aaron Williams
body: that gets automatically converted to an 'action' item in cloud :(


author: mbatten
body: Just want to add a simple solution that I found to this problem in case others are still looking to do this.

If the task does not have any text after it, it does not register as a task. So to create a checklist I put the task checkbox into a table cell by itself with the items for the checklist in a cell beside it.

It functions purely as a checkbox then with saved state and does not register as a task. Really easy to add with the shortcut \[\] as well.

image2016-8-8 21:8:40.png  
[](https://community.atlassian.com/t5/Confluence-questions/Is-there-a-way-in-Confluence-to-create-a-checkbox-without-it/qaq-p/243032?attachment-id=4857){#link_11891ec022fdc3}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/41153/1/image2016-8-8%2021%3A8%3A40.png){#display_11891ec022fdc3_0}

comments: author: Davin Studer
body: Nice work around.


author: .mike
body: not "working arround" with me.

placing the "checkbox-symbol" OUTSIDE the table (somewhere on the page) = OK  
saving the page will create a checkbox that users can click on the viewpage.

placing the "checkbox-symbol" INSIDE the table = NOK. users cannot click the checkbox on the viewpage.

see <https://answers.atlassian.com/questions/41460975>


author: Matt Batten
body: Still working fine for me after all these years, even in latest Confluence Cloud.


author: Alex Medved _ConfiForms_
body: Roland,

I understand you have no plans to spend money purchasing the plugin to help you with checkboxes, but may be, a bit more advanced plugin will help you to solve this particular problem, as well as anything else when you want to store some structured data in Confluence. Take a look at [ConfiForms](https://marketplace.atlassian.com/plugins/com.vertuna.confluence.plugins.confiforms)

Various types of forms: checklists, registrations, feedback... also, with rest api, so you can do some reporting when needed


author: Sushma
body: Hi [@Davin Studer](/t5/user/viewprofilepage/user-id/781467)

In your macro ,how to store the checkbox status as checked or unchecked ?

Suppose if we create a checkbox from the confluence UI ,we will get the status as complete or incomplete in the storage format as below.

```
<ac:task-list><ac:task><ac:task-id>1</ac:task-id><ac:task-status>incomplete</ac:task-status><ac:task-body><span>Type your task here, using &quot;@&quot; to assign to a user and &quot;//&quot; to select a due date</span></ac:task-body></ac:task></ac:task-list>
```

Similarly is it possible to get the status from your macro?

Please help me

Regards

Sushma

comments: author: Davin Studer
body: No. The user macro above does not create tasks ... so the task report won't work with it.


author: Sushma
body: Thanks for the response [@Davin Studer](/t5/user/viewprofilepage/user-id/781467)


author: Sushma
body: Hi [@Davin Studer](/t5/user/viewprofilepage/user-id/781467)

I have one doubt, If we create tasklist /task report from User macro in confluence, are we able to get the state/status of tasklist while viewing the storage format from the confluence page?

Regards

Sushma


author: Sushma
body: Any response ?


author: Matt Batten
body: Hi [@Sushma](/t5/user/viewprofilepage/user-id/2357142) I think you will need to look elsewhere for a solution as this was about creating a checkbox that is NOT a task.  

So the purpose is just to have a visual checkbox you can check/uncheck that will hold state.  

To do this, there is no task created.


author: Davin Studer
body: Yeah, unfortunately I don't have any great ideas for you.


author: Wayne Ritchie
body: Best bet is to hope someday Atlassian kills their crappy markup and adopts what is used almost everywhere else; GitHub, Slack, .... Checkboxes would be nice, but inline code blocks cannot even be created. ...no, \`code\` which converts the font to monospace is not how a inline code should appear!


author: George Cakiades
body: If you are creating the page from a template, the following code populates a checkbox:
> \<ac:task-list\>\<ac:task\>\<ac:task-id\>2\</ac:task-id\>\<ac:task-status\>incomplete\</ac:task-status\>\</ac:task\>\</ac:task-list\>

I don't think the task-id is very important, but you may want to increment it depending on what you're doing.


author: Ronald Yeshulas
body: A little more information might help. We have spaces for client projects. The space has an area with meeting notes and action items are identified during these meetings and tracked as tasks in confluence. Additional project work is tracked in JIRA. The main page of the clients space shows these action items. As part of the project plan there is a "shopping list" of items we need from the client. The space contains a page with a list of these items and I would like to turn this list into a checklist without adding to the action item list. I can filter tasks from that page using a label, but then I would also lose the ability to note action items/tasks on that page and wanted to avoid that.I think what I'm really going to need to do, is learn how to write my own macro for a checkbox and add it as a user macro, but I just don't have the time to do that right now.


author: Davin Studer
body: Is there a reason you can't use the task list for this?


author: Rodrigo Girardi Adami
body: Hi Ronald,

I believe you are looking to a macro like this one:[Checkbox](https://marketplace.atlassian.com/plugins/com.gumvillage.confluence.checkbox.checkbox) by [Gumvillage](https://marketplace.atlassian.com/vendors/1210690).

I hope this helps.

Cheers,

Rodrigo

comments: author: Ronald Yeshulas
body: Thanks for your response. I did see that macro, but was trying to avoid spending money for a checkbox.


author: David Skreiner
body: Addons also cause headaches when upgrading to the next build. I find it very unfortunate that most answers on answers.atlassian.com are someone telling us to buy paid plugins, especially considering the price of the base product.


author: Davin Studer
body: The above user macro is free. I promise I won't charge for it. :smile:


author: Jennifer Taylor
body: Looks like the macro above is no longer free.