Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When submitting data to a table element, the data does not get saved. Checking the site's logs, there are no errors reported.
I have been able to reproduce this issue with the following form configuration:
table_fieldset:
'#type': fieldset
'#title': Table data
table:
'#type': table
'#header':
- 'Data column 1'
- 'Data column 2'
- 'Data column 3'
'#rows':
-
table_1_column:
data:
table_data_row_1_col_1:
'#title': Datafield
'#title_display': invisible
'#type': textfield
'#size': 30
table_2_column:
data:
table_data_row_1_col_2:
'#title': Datafield
'#title_display': invisible
'#type': textfield
'#size': 30
table_3_column:
data:
table_data_row_1_col_3:
'#title': Datafield
'#title_display': invisible
'#type': textfield
'#size': 30
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer commentedThe below code is from the 'Example: Layout: Basic' form included in the webform_examples.module.
You just need to remove the 'rows' and 'data' key.
Comment #3
bobbygryzynger@jrockowitz - that did the trick, thanks!