<p>You're not going to be able to pull this off with the stock <code>elements/save-element</code> action by itself.</p>
<p>In addition to the workarounds you mention, you could consider handling the form submission with JavaScript, POSTing the form (with a different site ID and values for the translatable fields) once for each site, in a seamless manner.</p>
<p>A final option, which is possibly the cleanest (albeit not necessarily the simplest) is to forego the core <code>elements/save-element</code> action altogether, by implementing the necessary logic in a custom controller action in a <a href="https://craftcms.com/docs/4.x/extend/module-guide.html" rel="nofollow noreferrer">custom module</a>.</p>
<p>FWIW, the recent launch of <a href="https://github.com/craftcms/generator/" rel="nofollow noreferrer">Craft Generator</a> has made scaffolding both custom modules and individual system components (e.g., controllers) a bit simpler.</p>

CC BY-SA 4.0
2022-12-28T08:33:00.403Z
Thank you for your feedback. As there's no native solution for this, I like the custom module option, which seems cleaner and at least safer than the JS solution. Good point for no need to create useless fields, by filling the values within the custom module.
Romain P.
CC BY-SA 4.0
2022-12-28T08:37:10.027Z
Would you mind adding an example of how to loop through locales and save the matches to fields? My Entries are saved as Draft, and it's a bit challenging within the `EVENT_BEFORE_SAVE_ELEMENT`: I don't find out how to apply the translations to a Draft which doesn't already exists.
Romain P.
CC BY-SA 4.0
2022-12-27T23:51:40.063Z
2022-12-27T23:51:40.063Z
Mats Mikkel Rummelhoff
<p>I have an Entry field layout where only a few Plain Text fields are translatable.
Users can edit these Entries from front-end, and I'm looking for the most efficient way to let them save the translations as Draft from a single submit.</p>
<p>I know that I can force the site language where the Entry is saved to using this to the form:</p>
<blockquote>
<p>{{ input('hidden', 'siteId', site.id) }}</p>
</blockquote>
<p>But this is saving the whole form to this site, not a specific field.</p>
<p>Is there any way to save fields independently to a specific site?</p>
<p>The only solution I found is to:</p>
<ul>
<li>Duplicate the translated fields to non-translated fields</li>
<li>Add all of them on the front-end and hide them in the CP</li>
<li>On save, add an Event in a custom module to store their respective values to the correct site</li>
</ul>
<p>This works, but doesn't sound simple and clean at all.</p>

<localization><entry><form><multi-site><craft4>
Save Entry form values as Draft to translated site versions on a single submit
# Save Entry form values as Draft to translated site versions on a single submit

(Asked by: username_0 on 2022-12-23)

I have an Entry field layout where only a few Plain Text fields are translatable.
Users can edit these Entries from front-end, and I'm looking for the most efficient way to let them save the translations as Draft from a single submit.

I know that I can force the site language where the Entry is saved to using this to the form:

> {{ input('hidden', 'siteId', site.id) }}

But this is saving the whole form to this site, not a specific field.

Is there any way to save fields independently to a specific site?

The only solution I found is to:

* Duplicate the translated fields to non-translated fields
* Add all of them on the front-end and hide them in the CP
* On save, add an Event in a custom module to store their respective values to the correct site

This works, but doesn't sound simple and clean at all.

**Tags:** localization, entry, form, multi-site, craft4

---

## 1 answers

### Answer by username_1 on 2022-12-27. Score: 2

You're not going to be able to pull this off with the stock `elements/save-element` action by itself.

In addition to the workarounds you mention, you could consider handling the form submission with JavaScript, POSTing the form (with a different site ID and values for the translatable fields) once for each site, in a seamless manner.

A final option, which is possibly the cleanest (albeit not necessarily the simplest) is to forego the core `elements/save-element` action altogether, by implementing the necessary logic in a custom controller action in a [custom module](https://craftcms.com/docs/4.x/extend/module-guide.html).

FWIW, the recent launch of [Craft Generator](https://github.com/craftcms/generator/) has made scaffolding both custom modules and individual system components (e.g., controllers) a bit simpler.

> **Comments:**
> **username_0**: Thank you for your feedback. As there's no native solution for this, I like the custom module option, which seems cleaner and at least safer than the JS solution. Good point for no need to create useless fields, by filling the values within the custom module.  
> **username_0**: Would you mind adding an example of how to loop through locales and save the matches to fields? My Entries are saved as Draft, and it's a bit challenging within the `EVENT_BEFORE_SAVE_ELEMENT`: I don't find out how to apply the translations to a Draft which doesn't already exists.  

---

