Closed (fixed)
Project:
Webform
Version:
7.x-3.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 May 2012 at 23:08 UTC
Updated:
28 Jul 2012 at 05:54 UTC
When building a form I need an extra field so I can put an extra value such as a response rating for the question (not to do with weight or ordering of the questions) its that some questions carry different importance and in the backed the values are used in calculations
I not referring to question ordering/weight nor the users response to the question but an extra field were the admin can place a value against the question
I'm assuming it will be a hook_something()
Thanks
Comments
Comment #1
quicksketchYou can use hook_form_alter() on the 'webform_component_edit_form' form. Also take a look through webform.api.php, and the hook_webform_component_presave() hook in particular.
Custom coding requests are generally outside the realm of support in the Webform issue queue, so further questions around development probably won't be answered here.
Comment #2
vernond commentedYou can add an extra component and tick the box at Private on component edit page. Components marked as Private are only displayed to users with Results access.
Comment #3
chaloum commentedthanks quicksketch
@Vernond the value isn't seen by user
Comment #4
vernond commented@chaloum - You can mark the field as private and disabled (won't be seen by form user and is not changeable by folks with only results access), then populate it from your calculations during hook_webform_submission_presave(). I thought that may be easier than messing with form alter. If form alter works better for you, then go for it.
Comment #5
quicksketchClosing after lack of activity.