Hi, I’m trying to add all of the values together, as a total, from a multi-select field.
If choice 1 has a value of 10, and choice 2 has a value of 5… If they’re both selected, I’d like to populate the ‘total field’ with the sum of those selections (in this case it’d be 15 obvs).
Hey Chris, thanks for your reply… Checkboxes, would work equally well, and in fact, I’m working on that as an alternative, but I’ve got a similar problem… I can’t seem to add up the values… If choice 1’s Value is ‘10’ and choice 2’s Value is ‘5’. I try to perform a sum, but my returned total is 105 (just the values in sequence, as a number)… It’s kinda perplexing, I thought totalling up checkbox values would be a piece of cake, I must be missing something stupid
Hi Mark. First, try the :value modifier on the merge tag:
If that does not work, please export your form and share it with a file-sharing service, then post the link here so we can look at the form. Thank you.
OK, so for anyone looking to add up the values of checkboxes (either dynamically populated or not), here’s the solution. First thing’s first you’ll need Gravity Wiz ‘Populate Anything’… Then, point your ‘total’ field to the checkbox field by @ing it from the ‘default value’ socket, ie @{:10}
Then add this little gem to your theme’s functions.php