Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-09T21:04:05.213Z
Answers.Text: 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.
Answers.UserDisplayName: Keatyn Garton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-09T21:30:19.750Z
Answers.Text: 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.
Answers.UserDisplayName: Keatyn Garton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-10T08:47:15.893Z
Answers.Text: @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.
Answers.UserDisplayName: MoritzLost
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-09T19:51:23.453Z
Answers.LastActivityDate: 2022-03-09T19:51:23.453Z
Answers.UserDisplayName: MoritzLost
Body: <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>
  
Tags: <users><form><frontend><frontend-form><author>
Title: Is there a way to change the author of an entry on the frontend?
ThreadText: # 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](https://craftcms.com/knowledge-base/entry-form) that posts to the [`entries/save-entry` controller action](https://craftcms.com/docs/3.x/dev/controller-actions.html#post-entries-save-entry). 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:
  
  ```twig
  <form method="post" accept-charset="UTF-8">
    {{ 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() %}
    <select name="authorId">
      {% for user in authors %}
        <option value="{{ user.id }}">{{ user.fullName }}</option>
      {% endfor %}
    </select>
  
    <button type="submit">Save new author</button>
  </form>
  
  ```
  
  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**: @username_0 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.  
  
  ---
  
  