<p>I was going out of my mind trying to work this out. <a href="https://craftcms.stackexchange.com/users/4118/william-isted">William Isted</a> spotted that Craft is using <code>col1</code> as the fieldname in the table on the edit entry page. (You can see this in the inspector).</p>

<p>This is from <code>/admin/entries/rsvps/92-test</code></p>

<pre><code>&lt;textarea name="fields[guests][0][col1]" rows="1" style="min-height: 46px;"&gt;Ian&lt;/textarea&gt;
</code></pre>

<p>If I switch my forms <code>column1Handle</code> to <code>col1</code> it saves the entry and shows the data in Craft.</p>

<p>You can see from the database it <strong>was</strong> saving previous data under the <code>column1Handle</code> (e.g. <code>name</code>), however Craft wasn't using that handle to retrieve the data.</p>

<p>I guess the tables on the entry pages are either looking for the wrong fieldnames, or the example code is wrong, and should read:</p>

<pre><code>&lt;textarea name="fields[fieldHandle][0][col1]" rows="1"&gt;&lt;/textarea&gt;
&lt;textarea name="fields[fieldHandle][0][col2]" rows="1"&gt;&lt;/textarea&gt;
&lt;textarea name="fields[fieldHandle][0][col3]" rows="1"&gt;&lt;/textarea&gt;
</code></pre>

<p>Hope this helps save someone else the same headache I've just gone through.</p>

CC BY-SA 3.0
2016-02-12T20:08:35.737Z
2016-02-12T20:08:35.737Z
2017-04-13T12:51:00.303Z
Ian Nebbiolo
<p>See here for example front-end HTML code for all of Craft's default field types:  <a href="https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input" rel="noreferrer">https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input</a></p>

<p><strong>Matrix:</strong></p>

<pre><code>{# You need to include the 'type' input to identify the matrix block type you are submitting #}
&lt;input type="hidden" name="fields[fieldHandle][new1][type]" value="contacts"&gt;

{# All of your custom fields must be within a 'fields' array. #}
&lt;input type="text" name="fields[fieldHandle][new1][fields][field1Handle]"&gt;
&lt;input type="text" name="fields[fieldHandle][new1][fields][field2Handle]" &gt;
&lt;input type="text" name="fields[fieldHandle][new1][fields][field3Handle]" &gt;

{# For New Entries, you'll want to use the naming convention 
</code></pre>

<p>'new1', 'new2', 'new3' for each of your blocks.  For existing entries you 
can update those values to be the block IDs #}
    
    
    </p>

<p><strong>Table:</strong></p>

<pre><code>&lt;input type="hidden" name="fields[fieldHandle]" value=""&gt;
&lt;textarea name="fields[fieldHandle][0][col1]" rows="1"&gt;&lt;/textarea&gt;
&lt;textarea name="fields[fieldHandle][0][col2]" rows="1"&gt;&lt;/textarea&gt;
&lt;textarea name="fields[fieldHandle][0][col3]" rows="1"&gt;&lt;/textarea&gt;
&lt;input type="hidden" name="fields[fieldHandle][0][col4]"&gt;
&lt;input type="checkbox" name="fields[fieldHandle][0][col4]" value="1"&gt;

&lt;textarea name="fields[fieldHandle][1][col1]" rows="1"&gt;&lt;/textarea&gt;
&lt;textarea name="fields[fieldHandle][1][col2]" rows="1"&gt;&lt;/textarea&gt;
&lt;textarea name="fields[fieldHandle][1][col3]" rows="1"&gt;&lt;/textarea&gt;
&lt;input type="hidden" name="fields[fieldHandle][1][col4]"&gt;
&lt;input type="checkbox" name="fields[fieldHandle][1][col4]" value="1"&gt;
</code></pre>

<p><strong>Lightswitch:</strong></p>

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

CC BY-SA 3.0
2016-02-20T20:13:24.437Z
I've updated the table example above, and the example in the linked field guide to reflect the `col1` input naming that Ian describes below.
Ben Parizek
CC BY-SA 3.0
2016-02-08T14:28:13.303Z
2016-02-20T20:11:55.243Z
2016-02-20T20:11:55.243Z
Brad Bell
<p>Is it possible to populate a Matrix Field, Table and Lightbox using the GuestEntries plugin from an HTML form?</p>

<p>I'm trying to build an RSVP form, and am not having a lot of luck with different field types.</p>

<hr>

<p>Using the syntax from Brad's answer is working to create rows in the table on new entries, but it's not populating them. The below code creates two rows in the table, but they're empty.</p>

<pre><code>&lt;input type="text" name="fields[guests][0][name]" placeholder="Name" /&gt;
&lt;input type="text" name="fields[guests][1][name]" placeholder="Name" /&gt;
</code></pre>

<form><custom-fieldtype><guest-entries>
Populating tables and matrix fields using GuestEntries
# Populating tables and matrix fields using GuestEntries

(Asked by: username_0 on 2016-02-08)

Is it possible to populate a Matrix Field, Table and Lightbox using the GuestEntries plugin from an HTML form?
I'm trying to build an RSVP form, and am not having a lot of luck with different field types.

Using the syntax from Brad's answer is working to create rows in the table on new entries, but it's not populating them. The below code creates two rows in the table, but they're empty.

**Tags:** form, custom-fieldtype, guest-entries

---

## 2 answers

### Answer by username_1 on 2016-02-08. Score: 9 | Accepted answer

See here for example front-end HTML code for all of Craft's default field types:  https://straightupcraft.com/articles/craft-cms-field-guide-twig?view=input
Matrix:
{# You need to include the 'type' input to identify the matrix block type you are submitting #}


{# All of your custom fields must be within a 'fields' array. #}




{# For New Entries, you'll want to use the naming convention 

'new1', 'new2', 'new3' for each of your blocks.  For existing entries you 
can update those values to be the block IDs #}
    
    
    
Table:













Lightswitch:

> **Comments:**
> **username_2**: I've updated the table example above, and the example in the linked field guide to reflect the `col1` input naming that Ian describes below.  

---

### Answer by username_0 on 2016-02-12. Score: 3

I was going out of my mind trying to work this out. William Isted spotted that Craft is using col1 as the fieldname in the table on the edit entry page. (You can see this in the inspector).
This is from /admin/entries/rsvps/92-test
Ian

If I switch my forms column1Handle to col1 it saves the entry and shows the data in Craft.
You can see from the database it was saving previous data under the column1Handle (e.g. name), however Craft wasn't using that handle to retrieve the data.
I guess the tables on the entry pages are either looking for the wrong fieldnames, or the example code is wrong, and should read:




Hope this helps save someone else the same headache I've just gone through.


---

