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,
This module has full integration with Webform module but does NOT work with Webform Calculator module.
See attached screenshot. I am using a Number field for the Sliders. The Formula field provided by Webform Calculator module work perfectly with the Number field. It does not work with Number field when I change the field type from Text Field to Slider in the Number field settings.
Seems like it should be a easy fix. Would greatly appreciate a patch or a solution.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#6 | Trigger-change-2564903-6.patch | 1.05 KB | colemanw |
pcalcu.jpg | 29.47 KB | superdorx |
Comments
Comment #2
PetarB CreditAttribution: PetarB commentedDid you end up finding a solution to this?
Comment #3
rudam CreditAttribution: rudam commentedIm having he same issue right now. Will post here the solution... (if I find any...)
Comment #4
dodge CreditAttribution: dodge commentedAnyone had any luck getting this to work yet?
Comment #5
dodge CreditAttribution: dodge commentedI think I see why this happens, but not sure of the best way to resolve it.
Looking at the HTML for the webform elements, the normal number elements have this structure in the "name" attribute:
submitted[number_1]
The sliders have this structure:
__sliderfield[submitted][slider_1][value]
So you can get the value of the "number_1" component by using the token {number_1}, but by using the {slider_1} token in the webform calculator formula, it's trying to get the value directly from the "slider_1" component, when really it needs to go down one more level to its "value" child.
Comment #6
colemanw CreditAttribution: colemanw as a volunteer commentedLooks to me like the problem is that this module (sliderfield) does not trigger the 'change' event when the value is changed. This means javascript will not work correctly for webform_calculator as well as webform core conditionals, and other integrations.
Here is a patch to fix it:
Comment #7
colemanw CreditAttribution: colemanw as a volunteer commentedComment #8
dodge CreditAttribution: dodge commentedThanks for creating the patch but unfortunately it doesn't seem to work, for me at least. I still get "Enter correct value for slider_1 to see result." in my calculation fields.
Maybe there's still something else going on...
Comment #9
dodge CreditAttribution: dodge commentedComment #10
dodge CreditAttribution: dodge commentedComment #11
Chyvakoff CreditAttribution: Chyvakoff commentedHi.
Comment #12
zkrebs CreditAttribution: zkrebs commentedAny updates? The patch doesn't seem to fix my problem.
Update: the code changes listed above, in addition to the patch, seem to solve the problem, but only if the formula field is on the same page!