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,
I have a form where user can add unlimited tables in it, so have made it with unlimited feature with 'add another item' button. Now i want one extra text field to each table so that user can name/title each table he added. Is it possible?
Please go through the attachment which i have tried to put one field but could not post and get data.
Please Help me with this.
Thank you.
Comment | File | Size | Author |
---|---|---|---|
#4 | tablefield-1878596-3-add_title.patch | 47.62 KB | er_d0s |
#3 | tablefield-1878596-2-add_title.patch | 4.53 KB | er_d0s |
#1 | tablefield-1878596-add_title.patch | 3.59 KB | er_d0s |
table_field issue.jpg | 121.99 KB | chaithanya.kvk |
Comments
Comment #1
er_d0s CreditAttribution: er_d0s commentedHey there, I had a similar problem and was having issues with using tablefield with field_collection so I whipped up a quick solution.
The patch attached here will add a "Table header" textbox to the table field. I can see this being a common use case when you want multiple tables, my solution coud definitely be improved on.
Cheers!
Comment #2
er_d0s CreditAttribution: er_d0s commentedNow that I think about it, this could be a nice feature, I'd envisage it working like when you active "title" and "alt" on image fields with with image module.
My patch is kind of hackish, but if it's the kind of thing you guys would be interested to commit to the module I'd be happy to go through and do a more "proper" implementation... interested?
Comment #3
er_d0s CreditAttribution: er_d0s commentedAdded an upgrade thingy in case you already have table field instances defined on your site
YOU MUST RUN UPDATE.PHP!!!
Comment #4
er_d0s CreditAttribution: er_d0s commentedUploaded wrong patch in the last post, plz use this one
Comment #5
boboss CreditAttribution: boboss commentedI've tried your patch but doesn't apply against 7.x.2.1
6 out of 7 hunks FAILED
is against some other version or what?
finally can you just upload .module and .install files?
Comment #6
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedThe patch probably could use a reroll against the latest dev.
Comment #7
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedComment #8
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedComment #9
lolandese CreditAttribution: lolandese at HCL Technologies Limited commentedComment #10
philsward CreditAttribution: philsward commentedCurious how this differs from the already available "Table Description"? Other than the Table Description being the caption tag as opposed to something else, it serves the same purpose from what I can tell.
Comment #11
lolandese CreditAttribution: lolandese commentedI guess that at the time of the creation of the feature request the caption field was not available yet. Now that it is, indeed, it seems it serves the same purpose. Thus closing as being a duplicate of #1251738: Allow ability to set table caption.