Closed (fixed)
Project:
Webform
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
2 Nov 2006 at 21:13 UTC
Updated:
3 Jun 2008 at 00:13 UTC
There is a petition module available for drupal, but it requires installation of CiviCRM - a complicated affair.
Webform seems poised to accomplish this task too. I'd like to use Webform to generate a petition that allows the user to see all those who have previously signed. It seems like it would be easy enough to do if I only knew PHP better.
I envision calling the _webform_results_table function (sans the #, time, and IP address) within the confirmation message. Anybody able to assist? Thanks!
Comments
Comment #1
scottrussell-1 commentedOkay, after a little work, I've found a working solution. In the confirmation message section, insert this text/code...
Make sure you select "PHP Format" under the "Input Format" dropdown. For me, it worked exactly as I'd hoped!
Comment #2
scottrussell-1 commentedI've run into one stumbling block with this approach. The only way I can allow the website visitor to see the petition result is if I provide the anonymous user privileges to "access webform results" within the 'Administer --> Access Control' settings.
Unfortunately, I think there's a bug here regarding the "access webform results" privilege. I've set it up so that the administrator has full webform privileges (all are checked) but the authenticated and anonymous user have ONLY the 'access webform results' privilege.
For these two account types, "webform" is displayed at the root level of the navigation menu (and this links to http://examplesite.com/admin/webform). This option does not appear to an administrator account, except where it should (under Admin --> webform). When this root navigation choice is clicked, the authenticated & anonymous user have full access to administering the webform -- and this should NOT be happening.
Anyone else seeing this anomaly? Know how to remedy it? Thanks!
Comment #3
evanssd commentedThe php solution works well for me. What would I change to exclude one component, for example email address? Thanks in advance.
Comment #4
naught101 commentedthis is the same for version 5.x-1 so I've changed it.
thanks scott, for the phpcode. note you can also replace "arg(1)" with the node ID number and submit the code as a new node, and it also wrks fine.
I second evanssd's comment. it would be VERY useful to know how to exclude certain fields. email is a good example, but if it's for a petition, you might also have some fields like a "stay in touch" tick-box, which you wouldn't neccesarily want to display on a page of signed submissions.
with big petition pages, it might be a good idea to have the option to view these 50 entries at a time or something.
it would be really good to be able to do this be default with webform! it's a great module, and with this ability, it would be useful for SOOO many more things.
cheers
ned
Comment #5
naught101 commentedso... this works for me. it gets rid of the email column in the table. infact, even if you have multiple email components in your form, it'll get rid of all of them.
this is a patch on scott's code.
you can remove any column for any type in this way. you can also remove columns by name if you change 'type' for 'name'. make sure you spell the name correctly though!
I don't seem to have the problme that scott's having to do with anon users requiring editing permission. maybe because I'm using drupal 5.
Comment #6
quicksketchI'm closing this issue because it encourages the general practice of hacking the module directly, a bad Drupal practice. The same thing can now be accomplished using the "Additional Submission Code" option under the Advanced webform options.
Comment #7
Leech commentedThank you, works great for me!