<p>It looks like you are not targeting the action URL. When accessing a Craft controller, you'll need to use the <code>actionTrigger</code> in your URL:</p>

<p>Your current URL:</p>

<pre><code>http://talkbox.es:8888/index.php/tags/createTag
</code></pre>

<p>Should be updated to:</p>

<pre><code>http://talkbox.es:8888/index.php/actions/tags/createTag
</code></pre>

<p>The <a href="https://craftcms.com/docs/config-settings#actionTrigger" rel="nofollow">actionTrigger is configurable</a> so if you plan to reuse your code on multiple sites, you won't want to hard code that value. In twig, you can output that value using the <code>craft.config</code> variable:</p>

<pre><code>{{ craft.config.actionTrigger }}
</code></pre>

CC BY-SA 3.0
2016-04-29T14:02:07.703Z
I had tried with /actions/ in the url before but i still get `index.php/actions/tags/createTag 400 (Bad Request)` is there something i'm missing in my config file?
Maxim Siebert
CC BY-SA 4.0
2018-06-06T13:54:25.477Z
@MaximSiebert what was the cause of the Bad Request error? I am experiencing the same in a Craft 3 project
Mark
CC BY-SA 3.0
2016-04-29T05:37:04.470Z
2016-04-29T05:37:04.470Z
Ben Parizek
<p>Similar to the question asked here:
<a href="https://craftcms.stackexchange.com/questions/1171/how-to-add-a-tags-field-to-an-entry-form">How to add a tags-field to an entry form?</a></p>

<p>I am trying to create an entry form that can create tags. I'm using <a href="http://selectize.github.io/selectize.js/" rel="nofollow noreferrer">http://selectize.github.io/selectize.js/</a> for the select element.</p>

<p>I am currently able to submit the form with existing tags but when trying to create a new tag using</p>

<pre><code>$.post('/tags/createTag', data, function(response) {
    if (response.success) {
        alert('Success')
    } else {
        alert('Unable to create that tag.');
    }
});
</code></pre>

<p>I get <code>http://talkbox.es:8888/index.php/tags/createTag 404 (Not Found)</code></p>

<p>Let me know if you guys need any more information, I'll gladly get it for you! Thanks a ton in advance.</p>

<form><entry><tags>
Front-end form, creating a tag
# Front-end form, creating a tag

(Asked by: username_0 on 2016-04-29)

Similar to the question asked here:
How to add a tags-field to an entry form?
I am trying to create an entry form that can create tags. I'm using http://selectize.github.io/selectize.js/ for the select element.
I am currently able to submit the form with existing tags but when trying to create a new tag using
$.post('/tags/createTag', data, function(response) {
    if (response.success) {
        alert('Success')
    } else {
        alert('Unable to create that tag.');
    }
});

I get http://talkbox.es:8888/index.php/tags/createTag 404 (Not Found)
Let me know if you guys need any more information, I'll gladly get it for you! Thanks a ton in advance.

**Tags:** form, entry, tags


---

## 1 answers

### Answer by username_1 on 2016-04-29. Score: 2 | Accepted answer

It looks like you are not targeting the action URL. When accessing a Craft controller, you'll need to use the actionTrigger in your URL:
Your current URL:
http://talkbox.es:8888/index.php/tags/createTag

Should be updated to:
http://talkbox.es:8888/index.php/actions/tags/createTag

The actionTrigger is configurable so if you plan to reuse your code on multiple sites, you won't want to hard code that value. In twig, you can output that value using the craft.config variable:
{{ craft.config.actionTrigger }}

> **Comments:**
> **username_0**: I had tried with /actions/ in the url before but i still get `index.php/actions/tags/createTag 400 (Bad Request)` is there something i'm missing in my config file?  
> **username_2**: @MaximSiebert what was the cause of the Bad Request error? I am experiencing the same in a Craft 3 project  

---

