<p>Not tested. But it would seem to me that you could use a tags field on the backend, and a checkbox field on the front-end (built dynamically from the tags). To submit the data you could either: format the data on the front-end via javascript before form submission, or submit to a custom plugin controller that converts the checkbox data format to the expected tags format, before saving.</p>

<p>Unfortunately, I can't tell you what the proper format for submitting tag data is from a form (I assume an array of tagIds?). If anyone knows please leave a comment and I'l update the answer (or feel free to edit the answer yourself). Might even be as simple as setting the option values to the tagId values — idk.</p>

CC BY-SA 3.0
2015-04-22T18:52:24.500Z
2015-04-22T18:52:24.500Z
Douglas McDonald
<p>There's plugin for populating fields with dynamic data: <a href="https://github.com/lewisjenkins/craft-lj-dynamicfields" rel="nofollow">Dynamic Fields</a>. But I'm not sure if it works, when pulling data from the same entry you're rendering the field into.</p>

CC BY-SA 3.0
2015-04-22T11:38:20.417Z
cheers will take a look at it. First glance would suggest it does what I need.
Lettie
CC BY-SA 3.0
2015-04-22T14:50:04.983Z
Plugin works great on the back-end and populates the fields with data from tags. However it does not work on the front-end when pulling out the data. I've spoke to Lewis who created the plugin and he was very helpful but says he needs to look into and adjust the plugin to do this. So currently it won't do what I require.
Lettie
CC BY-SA 3.0
2015-04-23T09:12:54.393Z
@Lettie Since I last spoke to you I came up with a solution which I've posted as an answer.
Lewis Jenkins
CC BY-SA 3.0
2015-04-22T11:32:33.753Z
2015-04-22T11:32:33.753Z
carlcs
<p>I don't have enough reputation to post this as a comment, but this should help you pull the data on the front end with the LJ Dynamic Fields plugin.</p>

<p>Install the <a href="https://github.com/lewisjenkins/craft-lj-dynamicfields" rel="nofollow">LJ Dynamic Fields</a> plugin.</p>

<p>Create a 'Checkboxes (dynamic)' field with the following code:</p>

<pre><code>{% for tag in craft.tags %}
   { "value":"{{ tag.id }}" , "label":"{{ tag }}" }
   {% if not loop.last %},{% endif %}
{% endfor %}
</code></pre>

<p>Front-end template code:</p>

<pre><code>{% for tag in craft.tags %}
    &lt;label&gt;{{ tag }}&lt;/label&gt;
    &lt;input type="checkbox" value="{{ tag.id }}" {{ tag.id in entry.myCheckboxesDynamicField ? 'checked="checked"' }}&gt;
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-04-22T22:46:23.033Z
No need to post as a comment... This is a legit answer! :)
Lindsey D
CC BY-SA 3.0
2015-04-22T20:01:49.717Z
2015-04-22T20:08:42.107Z
2015-04-22T20:08:42.107Z
Lewis Jenkins
<p>Hi wondering if this is possible. I have a custom checkbox field for user interests added to the user profile. Is there a way to populate the checkbox options dynamically using tag data?</p>

CC BY-SA 3.0
2015-04-22T11:02:14.923Z
Any reason why you couldn't just use a [Tags](http://buildwithcraft.com/docs/tags-fields) field?
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2015-04-22T11:09:10.423Z
The data is going to be used on the front end so users can use checkboxes to select what they are interested in but using tag data as their selection choice so not sure a tag field will work.
Lettie
<tags><checkboxes>
How to populate a custom checkbox field with tag data dynamically?
# How to populate a custom checkbox field with tag data dynamically?

(Asked by: username_0 on 2015-04-22)

Hi wondering if this is possible. I have a custom checkbox field for user interests added to the user profile. Is there a way to populate the checkbox options dynamically using tag data?

**Tags:** tags, checkboxes
> **Comments:**
> **username_1**: Any reason why you couldn't just use a [Tags](http://buildwithcraft.com/docs/tags-fields) field?  
> **username_0**: The data is going to be used on the front end so users can use checkboxes to select what they are interested in but using tag data as their selection choice so not sure a tag field will work.  

---

## 3 answers

### Answer by username_4 on 2015-04-22. Score: 4 | Accepted answer

I don't have enough reputation to post this as a comment, but this should help you pull the data on the front end with the LJ Dynamic Fields plugin.
Install the LJ Dynamic Fields plugin.
Create a 'Checkboxes (dynamic)' field with the following code:
{% for tag in craft.tags %}
   { "value":"{{ tag.id }}" , "label":"{{ tag }}" }
   {% if not loop.last %},{% endif %}
{% endfor %}

Front-end template code:
{% for tag in craft.tags %}
    {{ tag }}
    
{% endfor %}

> **Comments:**
> **username_5**: No need to post as a comment... This is a legit answer! :)  

---

### Answer by username_2 on 2015-04-22. Score: 2

Not tested. But it would seem to me that you could use a tags field on the backend, and a checkbox field on the front-end (built dynamically from the tags). To submit the data you could either: format the data on the front-end via javascript before form submission, or submit to a custom plugin controller that converts the checkbox data format to the expected tags format, before saving.

Unfortunately, I can't tell you what the proper format for submitting tag data is from a form (I assume an array of tagIds?). If anyone knows please leave a comment and I'l update the answer (or feel free to edit the answer yourself). Might even be as simple as setting the option values to the tagId values — idk.


---

### Answer by username_3 on 2015-04-22. Score: 1

There's plugin for populating fields with dynamic data: [Dynamic Fields](https://github.com/lewisjenkins/craft-lj-dynamicfields). But I'm not sure if it works, when pulling data from the same entry you're rendering the field into.

> **Comments:**
> **username_0**: cheers will take a look at it. First glance would suggest it does what I need.  
> **username_0**: Plugin works great on the back-end and populates the fields with data from tags. However it does not work on the front-end when pulling out the data. I've spoke to Lewis who created the plugin and he was very helpful but says he needs to look into and adjust the plugin to do this. So currently it won't do what I require.  
> **username_4**: @Lettie Since I last spoke to you I came up with a solution which I've posted as an answer.  

---

