<p>Couldn't you have multiple forms on the page, and submit them via AJAX in sequence when the user clicks on the Submit button?</p>

CC BY-SA 3.0
2015-09-13T21:42:58.137Z
2015-09-13T21:42:58.137Z
andrew.welch
<blockquote>
  <p>I guess the first answer to this will be "write a plugin"</p>
</blockquote>

<p>I guess you're right. :)</p>

<p>Your plugin would have a controller that your front-end form posts to.  From there you grab all of the needed data from POST and perform any custom business logic you want, including saving multiple entries.</p>

<p>The official plugin docs are here: <a href="http://buildwithcraft.com/docs/plugins/introduction" rel="nofollow">http://buildwithcraft.com/docs/plugins/introduction</a></p>

<p>There is also a <a href="https://mijingo.com/products/screencasts/craft-plugin-development/" rel="nofollow">Craft Plugin Development</a> course on <a href="https://mijingo.com" rel="nofollow">Mijingo</a> that I've heard good things about.</p>

CC BY-SA 3.0
2015-07-15T19:23:44.900Z
2015-07-15T19:23:44.900Z
Brad Bell
<p>I am making/trying to make a reservation system with Craft. Logged-in members should be able to make a reservation for a hotel room on the front-end, and change it later.</p>

<p>I am keeping a stock for the available hotel rooms in entries. I have channel section called "rooms". In that section are 2 entries (= 2 different hotels). Every entry has information about the hotel (name, location,...) and has a matrix field with avaialble dates and stock for that date.</p>

<p>What I want to do: a logged-in user can choose a date and choose a number of rooms on that date. He should also fill in all his personal details. I was thinking about making entries of that info in a new channel (e.g. "reservations"). The hard part is: when a user selects a number of rooms, I want the stock of that night edited in the rooms entry. So if we heve 20 rooms available, and a member makes a reservation for 2, the stock should be set to 18.</p>

<p>I guess the first answer to this will be "write a plugin", but I have never written a plugin before, and I have no idea what's the best practice or where to start. Any ideas?</p>

<entries><users><frontend>
Edit multiple entries at once through the front-end
# Edit multiple entries at once through the front-end

(Asked by: username_0 on 2015-07-15)

I am making/trying to make a reservation system with Craft. Logged-in members should be able to make a reservation for a hotel room on the front-end, and change it later.

I am keeping a stock for the available hotel rooms in entries. I have channel section called "rooms". In that section are 2 entries (= 2 different hotels). Every entry has information about the hotel (name, location,...) and has a matrix field with avaialble dates and stock for that date.

What I want to do: a logged-in user can choose a date and choose a number of rooms on that date. He should also fill in all his personal details. I was thinking about making entries of that info in a new channel (e.g. "reservations"). The hard part is: when a user selects a number of rooms, I want the stock of that night edited in the rooms entry. So if we heve 20 rooms available, and a member makes a reservation for 2, the stock should be set to 18.

I guess the first answer to this will be "write a plugin", but I have never written a plugin before, and I have no idea what's the best practice or where to start. Any ideas?

**Tags:** entries, users, frontend


---

## 2 answers

### Answer by username_1 on 2015-09-13. Score: 2

Couldn't you have multiple forms on the page, and submit them via AJAX in sequence when the user clicks on the Submit button?


---

### Answer by username_2 on 2015-07-15. Score: 1

> I guess the first answer to this will be "write a plugin"

I guess you're right. :)

Your plugin would have a controller that your front-end form posts to. From there you grab all of the needed data from POST and perform any custom business logic you want, including saving multiple entries.

The official plugin docs are here: <http://buildwithcraft.com/docs/plugins/introduction>

There is also a [Craft Plugin Development](https://mijingo.com/products/screencasts/craft-plugin-development/) course on [Mijingo](https://mijingo.com) that I've heard good things about.


---

