<p><strong>Scenario</strong>:</p>

<p>I have a Structure section called Competitions that allows users to submit one or more (usually three maximum) entries to judged photo competitions. However, they can only submit one or two if they wish.</p>

<ul>
<li>Competitions (section)

<ul>
<li>Competition (parent entry type)

<ul>
<li>Submission (child entry type)</li>
</ul></li>
</ul></li>
</ul>

<p>The Submission entry type's field that the users need to edit are:</p>

<ul>
<li>Image order: a number field that is chosen from a radio button group. The number of buttons in the group corresponds to the number of entries the user has submitted. This is usually max 3. If I have the following order: Image 01, image 02, &amp; image 03, and the user deletes image 02, image 03's order needs to change to 02.</li>
<li>Critique image: a ligthswitch field in a single radio button. They can only select one image for critique.</li>
</ul>

<p>There's also an asset field for an image. This needs to be renamed according to the chosen image order. E.g: 01-compId-dateTime.jpg. I have this part working via a Craft 3 Module.</p>

<p>Here's an annotated screenshot to illustrate: <a href="https://cl.ly/ba29ed3cfc19" rel="nofollow noreferrer">https://cl.ly/ba29ed3cfc19</a></p>

<p>I tried to do this via Javascript (Vue.js), but it breaks when an entry is deleted. In the end, it's just not robust enough, and I prefer having a single save button that sends all form data to the server. Here's that attempt: <a href="https://craftcms.stackexchange.com/questions/27958/how-can-i-edit-multiple-entries-via-multiple-front-end-forms-using-vue-js">How can I edit multiple entries via multiple front-end forms using Vue.js?</a></p>

<p>I found this post <a href="https://craftcms.stackexchange.com/questions/8682/how-do-i-create-a-plugin-to-create-and-save-multiple-entries-from-one-front-end">How do I create a plugin to create and save multiple entries from one front-end form?</a>, but the answer isn't detailed enough for my current skill level, and it's for Craft 2. Same with this: <a href="https://craftcms.stackexchange.com/questions/10586/edit-multiple-entries-at-once-through-the-front-end">Edit multiple entries at once through the front-end</a>. The answer at <a href="https://craftcms.stackexchange.com/questions/22749/entry-form-multiple-entries-entry-type-parent">Entry Form - Multiple Entries &amp; Entry Type &amp; Parent</a> contains the detail I need, but it's for Craft 2.</p>

<p>Many thanks for your help.</p>

CC BY-SA 4.0
2018-11-01T07:04:38.810Z
It was Craft 2, but I did a competition entry like this using the Guest Entries plugin and a Matrix field for the images. I'd take the same approach again, most likely. Each image (up to 3) was a Matrix block within the same field. I'd question why image 3 would need renaming to Image 2 if the existing Image 2 is deleted though, although it should be easy enough to handle with JS. I just listed three file upload fields: Image 1, Image 2, Image 3 and if people left Image 2 blank, so what?
Clive Portman
CC BY-SA 4.0
2018-11-01T13:46:02.697Z
The image submissions (entries) also need to scored by 3 different judges. Each judge edits each entry and enters a score. Judge 1 -> score 1, Judge 2 -> score 2 etc. the field layout for submissions contains these score fields in addition to calculated fields via Preparse plugin to average scores, rank them and more. I have this part working OK. I'm just stuck on allowing users to change the order in which their submissions are judged without having to edit each entry individually.
Andrea DeMers
CC BY-SA 4.0
2018-11-01T17:12:09.140Z
So is it only about changing the order or editing them entirely? When your function to create those entries already exists there is no need to create the same function again just with the ability to change the order. Creating and Updating in Craft is basically the same
Robin Schambach
<plugin-development><entries><craft3><form>
How can I create a Module/Plugin to edit multiple entries via a single front-end form in Craft 3?
# How can I create a Module/Plugin to edit multiple entries via a single front-end form in Craft 3?

(Asked by: username_0 on 2018-10-31)

**Scenario**:

I have a Structure section called Competitions that allows users to submit one or more (usually three maximum) entries to judged photo competitions. However, they can only submit one or two if they wish.

* Competitions (section)
  + Competition (parent entry type)
    - Submission (child entry type)

The Submission entry type's field that the users need to edit are:

* Image order: a number field that is chosen from a radio button group. The number of buttons in the group corresponds to the number of entries the user has submitted. This is usually max 3. If I have the following order: Image 01, image 02, & image 03, and the user deletes image 02, image 03's order needs to change to 02.
* Critique image: a ligthswitch field in a single radio button. They can only select one image for critique.

There's also an asset field for an image. This needs to be renamed according to the chosen image order. E.g: 01-compId-dateTime.jpg. I have this part working via a Craft 3 Module.

Here's an annotated screenshot to illustrate: <https://cl.ly/ba29ed3cfc19>

I tried to do this via Javascript (Vue.js), but it breaks when an entry is deleted. In the end, it's just not robust enough, and I prefer having a single save button that sends all form data to the server. Here's that attempt: [How can I edit multiple entries via multiple front-end forms using Vue.js?](https://craftcms.stackexchange.com/questions/27958/how-can-i-edit-multiple-entries-via-multiple-front-end-forms-using-vue-js)

I found this post [How do I create a plugin to create and save multiple entries from one front-end form?](https://craftcms.stackexchange.com/questions/8682/how-do-i-create-a-plugin-to-create-and-save-multiple-entries-from-one-front-end), but the answer isn't detailed enough for my current skill level, and it's for Craft 2. Same with this: [Edit multiple entries at once through the front-end](https://craftcms.stackexchange.com/questions/10586/edit-multiple-entries-at-once-through-the-front-end). The answer at [Entry Form - Multiple Entries & Entry Type & Parent](https://craftcms.stackexchange.com/questions/22749/entry-form-multiple-entries-entry-type-parent) contains the detail I need, but it's for Craft 2.

Many thanks for your help.

**Tags:** plugin-development, entries, craft3, form
> **Comments:**
> **username_1**: It was Craft 2, but I did a competition entry like this using the Guest Entries plugin and a Matrix field for the images. I'd take the same approach again, most likely. Each image (up to 3) was a Matrix block within the same field. I'd question why image 3 would need renaming to Image 2 if the existing Image 2 is deleted though, although it should be easy enough to handle with JS. I just listed three file upload fields: Image 1, Image 2, Image 3 and if people left Image 2 blank, so what?  
> **username_0**: The image submissions (entries) also need to scored by 3 different judges. Each judge edits each entry and enters a score. Judge 1 -> score 1, Judge 2 -> score 2 etc. the field layout for submissions contains these score fields in addition to calculated fields via Preparse plugin to average scores, rank them and more. I have this part working OK. I'm just stuck on allowing users to change the order in which their submissions are judged without having to edit each entry individually.  
> **username_2**: So is it only about changing the order or editing them entirely? When your function to create those entries already exists there is no need to create the same function again just with the ability to change the order. Creating and Updating in Craft is basically the same  

---

## 0 answers

