<p>Each input name needs to have the following format:</p>

<pre><code>fields[FieldHandle][RowId][ColId]
</code></pre>

<p>It doesn’t matter what you set <code>RowId</code> to, as long as it’s the same for all of the columns in that row. (Table fields in the CP just get incrementing row IDs - <code>0</code>, <code>1</code>, <code>2</code>, etc.)</p>

<p><code>ColId</code>, on the other hand, needs to be based on your actual column IDs. The only way to get those would be to inspect a Table field’s HTML on your Edit Entry page:</p>

<p><img src="https://i.sstatic.net/DRd3i.png" alt="Table field’s HTML in Craft CMS"></p>

<p>Each column will have an ID in the format of <code>colN</code>. “<code>N</code>” won’t necessarily be <em>nth</em> column in the table though; it will be the <em>nth</em> column you’ve created in the table since the field was first created, regardless of how they are ordered or whether any columns had ever been deleted. Which is why it’s best to just inspect the table HTML rather than trying to guess what the column ID will be.</p>

<p>So in your case, that <code>&lt;td&gt;</code> line should look something like this:</p>

<pre><code>&lt;td&gt;&lt;input type="text" id="accreditingInstitution" name="fields[providerCredentials][0][col1]" value="{{ row.accreditingInstitution }}"&gt;&lt;/td&gt;
</code></pre>

CC BY-SA 3.0
2014-11-21T14:45:18.660Z
2014-11-21T15:32:46.850Z
2014-11-21T15:32:46.850Z
Brandon Kelly
<p>Similar to <a href="https://craftcms.stackexchange.com/questions/4853/edit-multi-select-field-from-front-end">this question</a>, I'm trying to make a table field type editable from a front end form.</p>

<p>When I update from the CP, the changes are reflected on the front end, but the following code doesn't allow updating from the front end form itself.</p>

<p>Is there anything I'm missing?</p>

<p>(perhaps adding how each field type can be edited from a front end form should be added to the docs)</p>

<pre><code>&lt;table&gt;
    {% for row in currentUser.providerCredentials %}
    &lt;tr&gt;
        &lt;td&gt;Institution&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" id="accreditingInstitution" name="fields[accreditingInstitution][]" value="{{ row.accreditingInstitution }}"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    {% endfor %}
&lt;/table&gt;
</code></pre>

<templating><form>
Edit a table field type from the front end
# Edit a table field type from the front end

(Asked by: username_0 on 2014-11-21)

Similar to this question, I'm trying to make a table field type editable from a front end form.
When I update from the CP, the changes are reflected on the front end, but the following code doesn't allow updating from the front end form itself.
Is there anything I'm missing?
(perhaps adding how each field type can be edited from a front end form should be added to the docs)

    {% for row in currentUser.providerCredentials %}
    
        Institution
        
    
    {% endfor %}

**Tags:** templating, form

---

## 1 answers

### Answer by username_1 on 2014-11-21. Score: 6 | Accepted answer

Each input name needs to have the following format:
fields[FieldHandle][RowId][ColId]

It doesn’t matter what you set RowId to, as long as it’s the same for all of the columns in that row. (Table fields in the CP just get incrementing row IDs - 0, 1, 2, etc.)
ColId, on the other hand, needs to be based on your actual column IDs. The only way to get those would be to inspect a Table field’s HTML on your Edit Entry page:

Each column will have an ID in the format of colN. “N” won’t necessarily be nth column in the table though; it will be the nth column you’ve created in the table since the field was first created, regardless of how they are ordered or whether any columns had ever been deleted. Which is why it’s best to just inspect the table HTML rather than trying to guess what the column ID will be.
So in your case, that  line should look something like this:


---

