Closed (won't fix)
Project:
Webform
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2008 at 17:24 UTC
Updated:
23 Mar 2018 at 21:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quicksketchThis currently isn't possible. The example you linked to is something entirely different from the current grid component. To get this functionality, you'd need to create a new component for Webform to use.
Comment #2
waynedrupal commentedThank you for your response.
Is it possible, though, to change:
'#type'=> 'radios',to
'#type'=> 'textfield',and all instances of radios to text fields in grid.inc file without having to create a new component?
Comment #3
quicksketchThat might make the component show up in the form, but we'd need to rewrite the code for sending e-mail, CSV download, analysis, and summary information. I'm not sure it would save correctly either.
Comment #4
waynedrupal commentedSo a new componant it is. I have placed a bounty on this as I need to have this functionality.
Is it possible, to also include both a text input as well as a drop-down select on the same component? For example:
One | Two | Three | Four
1. txt_field | txt_field | drop_down_select | txt_field
2. txt_field | txt_field | drop_down_select | txt_field
3. txt_field | txt_field | drop_down_select | txt_field
Where the drop_down_select would be four or five choices?
Comment #5
ambientdrup commentedI'm looking for this type of functionality/tweak to the Webform grid? Is anyone working on an enhancement currently? It would be great if we had a choice of data fields to use in the grid (radio buttons, checkboxes, text fields, etc).
-backdrifting
Comment #6
Mark B commentedI've written a new .inc file to support text fields in a grid layout. It supports either text or numeric data types, and you can choose the size of the text fields. It took a bit of jiggery-pokery to make the two-dimensional grid values save in a one-dimensional database format, but it works fine. The email, analysis and download elements have been updated too.
There are a few caveats:
1. data is stored in the database using indexes rather than keys, so any changes to the grid rows or columns will disrupt all previously submitted forms (although that's also the case in the regular grid component, which this is based on)
2. the analysis page just shows how many submissions had a value in each field in the grid - it doesn't break out the actual values
3. the validation on numeric fields doesn't highlight the invalid field - I can't the right field reference in form_set_error. If anyone can straighten that out I'm all ears
The biggest problem I have is that for some reason drupal.org will only let me attach jpg, jpeg, gif or png files, so I've had to rename the file to a jpg. To use this component, you'll have to rename the attached file to textgrid.inc and copy it into the components directory of your webform module.
This component was written and tested against Webform 5.x-2.2
Comment #7
brei9000 commentedMark B, this is exactly what I was looking for!!
I put the .inc file into my components folder... what do I do from there? I'm sorry for the newb question.
Thanks!!
Comment #8
Mark B commentedOh yeah - I should probably have mentioned this in the earlier post!
Once the .inc file is in your components folder, you need to enable the textgrid component type in admin/settings/webform. You should then be able to add fields of that type to your forms.
Comment #9
z33k3r commentedThe textgrid.inc does not work for me...
I can enable the plugin (which enables itself by default, btw) but when i enter the required fields, it returns divs without a containing div, labels, desc. text or formatting... Also, I don't believe that the field size should be a requirement...
Comment #10
roball commentedAre there any plans to put such a functionality into a 6.x version?
Comment #11
quicksketchNo, not currently. I'm working on making the Drupal 6 3.0 version of Webform more pluggable so that other modules can provide their own fields. But right now this sort of functionality is not compatible with the way Webform stores data, which makes the task significantly more difficult.
Comment #12
vtemor commentedI am building a form that needs similar functionality to the component above, but for Webform 6.x-2.7. Has anyone coded this?
Comment #13
vtemor commentedComment #14
barry_fisher commentedDid anyone find a solution for this? I'm also not getting labels rendered to the output. I'm looking into why not but thought I should ask before digging deep if the fix already exists. Thanks.
Comment #15
sol1313 commentedHi,
I am really close to finding the solution. I used Mark B (thank you!) component and almost got it to work. If anyone wants to help me, maybe we can work it out together? There are several people looking for the same thing as I have seen on several different posts. I have figured out that the component above is not using the theme within the component which is why it is not displaying properly. I modified the code to call the theme of the radio button grid, and at least it is displaying correctly, but my labels are all gone. If anyone wants to tackle this together, please let me know. I would love to help create an add on to this module.
You can view an example here: http://soldesigns.net/ishopinusa/content/request-quote-0
I have attached what I have so far. I change to change the extension to .info since .inc are not allowed.
Thanks,
Sol
Comment #16
roball commentedI had a look at your test site, sol1313, which shows the warning
Invalid argument supplied for foreach() in /home/content/s/o/l/soldesigns/html/ishopinusa/modules/webform/components/grid.inc on line 387.Comment #17
aaron stanush commented+1 for this feature. I'm looking to build a webform for tracking sick/vacation time of employees (see attached mockup).
Comment #18
ezraw commented+1
Comment #19
mohanprabu2 commentedMe too looking for this component. Please refer me the component if exist..thanks.
Comment #20
scott m. sanders commentedSubscribing.
Comment #21
quicksketchMoving this to the 3.x version. Now that we have more robust data storage (see #712324: Convert Select and Grid Options to New Data Storage), this is at least now feasible. The database storage in 2.x makes even attempting this feature nearly impossible to accomplish.
Comment #22
stella commentedsubscribe
Comment #23
geerlingguy commentedWould love this functionality. Subscribe :D
Comment #24
ellanylea commented+1 subscribing
Comment #25
ShannonK commentedSubscribing.
Comment #26
Sinan Erdem commented+1
Comment #27
AdamFx commentedsubscribing.
This functionality would be great for a form I am developing. Interestingly googleApps Form doesn't offer this either.
For me I am looking for a grid to users to enter data over time
Columns month1, month2, month3, month4, month5, month6
Rows Q1, Q2, Q3, Q4, Q5, Q6
Any developments on this that are worth trying?
Thanks
AdamFx
Comment #28
quicksketchNo progress, since this is still a difficult problem to solve with our data architecture. It's been improved now, but no matter how you look at it this is a lot of data to store.
Comment #29
yesct commentedsubscribing.
#28 says there have been improvements. Is that a reference to a patch in another issue?
I'm also wondering if we could "fake" a grid by storing each cell separately, as if it were a separate part of the form, but just *display* it in a grid.
Like if the columns are named: Mon Tues Weds
And the rows are: morning afternoon evening
Then the first cell could have a name for use in the db and on emails and results analysis pages like: Mon_morning, the second cell and so on would be: Tues_morning Weds_morning Mon_afternoon Tues_afternoon Weds_afternoon Mon_evening Tues_evening Weds_evening
Or some other naming rule...
But, I'm wondering if a solution for some of us is that the people entering the data want to see it as a grid, maybe other internal parts and people can just see a longer list of individual fields?
Comment #30
yesct commentedI dont know if http://drupal.org/project/arrange_fields might help in some situations.
Comment #31
yesct commentedtalked with quicksketch, will try and summarize.
thought a grid that allows text fields should be a separate new webform component type. not expanding grid, but maybe re-using some of the grid code. Maybe call the new component textgrid.
webform right now stores three keys
for every value. that being Component ID, Submission ID, and Key
problem:
"questions" (options along the left) and the "options"
(options along the top) of the table are BOTH keys, and then you need
to store user-entered value in the "value" column
so you'd need "key1" and "key2" in the database
but we only have one "key" column
fortunately there is a potentially easy solution of just mashing key1 and key2 together like "key1-key2" and putting it into the "key" column
there was a concern about would they ever need to be taken apart again. but, won't need to split
them apart, since that will be the the "name" attribute of the textfield too
How to represent this data in a CSV file? since it's a 3-dimensional grid, not a 2-d one. maybe it'd look like a multi-value select field without X's, instead with values in each one
webform will handle the storage in the database, but when editing a submission it's going to give you an
array of $values, which will be keyed like $values['q1o1'] = $user_text
like to do $form['q1']['o1'] as each textfield so you could loop through it easily when you theme it into a
table
----
I don't understand it yet, but hopefully can come to understand with some more dialog. I hope this helps others, or sparks an idea with someone.
Comment #32
ddyrr commentedI had started writing my own version of this before I saw this post. The way I did it was to remove the row labels, and replace it with the number of rows to show. I wanted something a little more like flexifield in cck, where I could have rows of the same questions, with the ability for the user to add additional rows. This is much easier to store in the db, since the data is the actual data being entered. The only problem is that you don't get row labels if you really want the grid style.
Comment #33
nicolash commentedsubscribing
Comment #34
gwlangie commentedI am in the need for this functionality. Has any progress been made?
Comment #35
lefnire commentedsubscribing
Comment #36
dgastudio commentedsubscribe
Comment #37
fr34ck commentedsubscribing
Comment #38
quicksketchI'm moving this to postponed. I have no intention of including this functionality directly in Webform core, but any module could add it through hook_webform_component_info(). When a 3rd-party solution becomes available, I will mark this issue as won't fix.
Comment #39
nicktech commentedsubscribing
Comment #40
artatac commentedSub
Comment #41
sourcesoft commentedsubscribing, I need it here in this project. any idea when we gonna add this functionality?
Comment #42
jelle_ssubscribing
Comment #43
mario002e commentedsubscribing
Comment #44
bkosbornesub - i can see how difficult this is to implement. just want to track this thread to see any progree.
Comment #45
jelle_sWe needed this component too and managed to implement it for Drupal 6
see: Webfrom Table Element
Comment #46
truyenle commented+subsribe.
I need to have this and I think it is popular for most application forms. See image.
Any clue, please help.
Comment #47
attiks commentedHave a look at http://www.drupal.org/project/webform_table_element, it can build a form like that
Comment #48
danchadwick commentedClosing for lack of activity and 6.x development. There is a matrix component for 7.x
Comment #49
quicksketchFor posterity for others looking for this capability:
https://www.drupal.org/project/webform_table_element
and
https://www.drupal.org/project/webform_matrix_component