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.
Hi,
The TableField module is working great on my custom content type. I am trying to add this field to a custom form I am building. I tried the following codes but they are not producing any fields. How can I use the tablefield type on a custom form?
$form['custom_field_test'] = array(
"#type" => "tablefield",
"#title" => t("Testing...")
);
Thanks,
Roosevelt
Comments
Comment #1
vitalie CreditAttribution: vitalie commentedTablefield is not available as a form element, though it would have been nice to have it. (The dev D8 branch has it actually).
For now all you can do is to try to use the field widget form. But for this you have to have a content type that uses the tablefield. So code like this:
Comment #2
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedThis seems to be answered. Feel free to reopen if still help on this issue is needed using the latest version.
Comment #3
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedHave also a look at the Table Element module.