I've got a 'booking' channel and an 'event' channel setup. Through the frontend, I need the logged in user to be able to submit a saveEntry form on the frontend which saves a new entry in the booking channel. The booking channel has two fields, both Entries fields. The first field is a relation to one user (the logged in user), and the second field is a relation to a single entry in the events channel.
When I submit the form, the entry is being created in the booking channel, both both Entries fields are blank. How do I make it save the related entries? Can't find any documentation on it.
Existing code:
<h2>Summary</h2>
<form method="post" action="" accept-charset="UTF-8" class="custom">
<input type="hidden" name="action" value="entries/saveEntry">
<input type="hidden" name="redirect" value="events/{{event.slug}}">
<input type="hidden" name="sectionId" value="18">
<input type="hidden" name="enabled" value="1">
<input type="hidden" name="fields[userBooking]" value="{{user.username}}">
<input type="hidden" name="fields[eventBooking]" value="{{eventID}}">
<input type="submit" value="Confirm Booking">
</form>
Short version: How do I save a related entry through a frontend form?