<p>You'd use this syntax:</p>

<pre><code>&lt;input type="hidden" name="fields[fieldHandle][]" value="123" /&gt;
</code></pre>

<p>Note the value should be the ID of the entry you want related. There's a handy guide here for the front-end syntax for all of Craft's field types: <a href="https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input" rel="nofollow noreferrer">https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input</a></p>

CC BY-SA 3.0
2017-03-22T18:37:00.223Z
2017-05-18T20:36:56.550Z
2017-05-18T20:36:56.550Z
Brad Bell
<p>I have two sections: </p>

<ul>
<li>Drinks</li>
<li>Ingredients</li>
</ul>

<p>I have a relation/entry field set on the drinks. So for example, two entries in the ingredients section are related to a specific drink.</p>

<p>My question:</p>

<p>I have a guest entries form, which submits new ingredients and I want to relate this (or these..) ingredient(s) to the current drink. How would I go about doing this?</p>

<p>Creating the ingredient itself is not the problem. The problem is relating it to the drink.</p>

<p>For example, is there a hidden input where I can pass along a new array?</p>

<p>Thanks in advance,</p>

<p>Steve</p>

<relations><relatedto><plugin-guestentries>
Basic Relation save
# Basic Relation save

(Asked by: username_0 on 2017-03-22)

I have two sections:

* Drinks
* Ingredients

I have a relation/entry field set on the drinks. So for example, two entries in the ingredients section are related to a specific drink.

My question:

I have a guest entries form, which submits new ingredients and I want to relate this (or these..) ingredient(s) to the current drink. How would I go about doing this?

Creating the ingredient itself is not the problem. The problem is relating it to the drink.

For example, is there a hidden input where I can pass along a new array?

Thanks in advance,

Steve

**Tags:** relations, relatedto, plugin-guestentries


---

## 1 answers

### Answer by username_1 on 2017-03-22. Score: 1

You'd use this syntax:


Note the value should be the ID of the entry you want related. There's a handy guide here for the front-end syntax for all of Craft's field types: https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input


---

