How to add a tags-field to an entry form? I use the following entry form (front-end): https://craftcms.com/docs/templating/entry-form

How can I add a tags-field to this entry form?
You would need to add inputs to the form based on your Tags field handle, with values set to the tag IDs that should be selected.

Here’s a very simple example – it creates a big checkbox list of all the existing tags:

&lt;div id="tags"&gt;
    {% for tag in craft.tags.group('myTagsGroup').limit(null) %}
        &lt;label&gt;
            &lt;input type="checkbox" name="fields[myTagsField][]" value="{{ tag.id }}"&gt;
            {{ tag.name }}
        &lt;/label&gt;
    {% endfor %}
&lt;/div&gt;


Note that it is not possible to create new tags directly from a Tags field. If you want users to also be able to create new tags from your form, that will require a little Javascript.

&lt;a id="new-tag"&gt;+ New tag&lt;/a&gt;

&lt;script type="text/javascript"&gt;

    $('#new-tag').click(function()
    {
        var name = prompt('What’s the new tag name?');

        if (!name) return;

        var data = {
            groupId: 1,
            name: name
        };

        $.post('/actions/tags/createTag', data, function(response)
        {
            if (response.success)
            {
                $('&lt;label&gt;' +
                      '&lt;input type="checkbox" name="fields[myTagsField][]" value="'+response.id+'" checked="checked"/&gt; ' +
                    name +
                  '&lt;/label&gt;').appendTo($('#tags'));
            }
            else
            {
                alert('Unable to create that tag.');
            }
        });
    });

&lt;/script&gt;


Make sure to set the correct groupId in that data object. You can find your tag group’s ID by looking at the URL when editing the group’s settings within Craft’s CP.