<p>You can use a <a href="https://craftcms.com/knowledge-base/entry-form" rel="nofollow noreferrer">custom entry form</a> that posts to the <a href="https://craftcms.com/docs/3.x/dev/controller-actions.html#post-entries-save-entry" rel="nofollow noreferrer"><code>entries/save-entry</code> controller action</a>. The first link includes a full Twig example. To edit an existing entry, make sure to include the <code>entryId</code> (for example, as a hidden input). Then include an <code>authorId</code> parameter with the ID of the new author to assign the entry to. This will also work for newly created entries.</p>
<p>Here's a stripped down example for a form to edit an existing entry and select a new author from a select field:</p>
<pre class="lang-twig prettyprint-override"><code>&lt;form method=&quot;post&quot; accept-charset=&quot;UTF-8&quot;&gt;
  {{ csrfInput() }}
  {{ actionInput('entries/save-entry') }}

  {# replace with the ID of the entry that's being edited, unless it's a new one #}
  {{ hiddenInput('entryId', 123) }}

  {% set authors = craft.users().all() %}
  &lt;select name=&quot;authorId&quot;&gt;
    {% for user in authors %}
      &lt;option value=&quot;{{ user.id }}&quot;&gt;{{ user.fullName }}&lt;/option&gt;
    {% endfor %}
  &lt;/select&gt;

  &lt;button type=&quot;submit&quot;&gt;Save new author&lt;/button&gt;
&lt;/form&gt;
</code></pre>
<p>Check the links above for more examples and a list of supported parameters.</p>

CC BY-SA 4.0
2022-03-09T21:04:05.213Z
So this didn't actually change the author of the entry. It still posted the entry as myself when I chose the author as a different user.
Keatyn Garton
CC BY-SA 4.0
2022-03-09T21:30:19.750Z
I tried exactly what you said and it doesn't appear to work. Reading the documentation you linked, it makes sense to me that this would work, but I am not having success with this approach. Each time I submit the form, I am the author even when I select another user.
Keatyn Garton
CC BY-SA 4.0
2022-03-10T08:47:15.893Z
@KeatynGarton Hm, difficult to say why it's not working. Do you have the permission to assign entries to different users? Also, are the users you're trying to assign the post to not suspended or locked? Maybe post the Twig code for the form in your question, then I can take a look.
MoritzLost
CC BY-SA 4.0
2022-03-09T19:51:23.453Z
2022-03-09T19:51:23.453Z
MoritzLost
<p>So, I know that you can do this on the backend. But is there a way to change the author of an entry from a frontend form? I'm making a vacation request system and I'm wanting managers to be able to add new requests for other users.</p>

<users><form><frontend><frontend-form><author>
Is there a way to change the author of an entry on the frontend?
# Is there a way to change the author of an entry on the frontend?

(Asked by: username_0 on 2022-03-09)

So, I know that you can do this on the backend. But is there a way to change the author of an entry from a frontend form? I'm making a vacation request system and I'm wanting managers to be able to add new requests for other users.

**Tags:** users, form, frontend, frontend-form, author

---

## 1 answers

### Answer by username_1 on 2022-03-09. Score: 2

You can use a custom entry form that posts to the entries/save-entry controller action. The first link includes a full Twig example. To edit an existing entry, make sure to include the entryId (for example, as a hidden input). Then include an authorId parameter with the ID of the new author to assign the entry to. This will also work for newly created entries.
Here's a stripped down example for a form to edit an existing entry and select a new author from a select field:

  {{ csrfInput() }}
  {{ actionInput('entries/save-entry') }}

  {# replace with the ID of the entry that's being edited, unless it's a new one #}
  {{ hiddenInput('entryId', 123) }}

  {% set authors = craft.users().all() %}
  
    {% for user in authors %}
      {{ user.fullName }}
    {% endfor %}
  

  Save new author


Check the links above for more examples and a list of supported parameters.

> **Comments:**
> **username_0**: So this didn't actually change the author of the entry. It still posted the entry as myself when I chose the author as a different user.  
> **username_0**: I tried exactly what you said and it doesn't appear to work. Reading the documentation you linked, it makes sense to me that this would work, but I am not having success with this approach. Each time I submit the form, I am the author even when I select another user.  
> **username_1**: @KeatynGarton Hm, difficult to say why it's not working. Do you have the permission to assign entries to different users? Also, are the users you're trying to assign the post to not suspended or locked? Maybe post the Twig code for the form in your question, then I can take a look.  

---

