Hi all-

I've looked at the other issues but am a bit stumped.

I have a form that contains 4 'amount' fields, and I need to create a 5th that is populated with a calculated value (2.75% of the sum of the 4 amount fields) so it can be included in the 'tally' for a webform payment. I've tried using a markup field (sticking the calculated field and payment component on a second page of the form) but can't seem to access the submitted values. I don't really care if it stays a one or two page form so long as I can get it to work! Any ideas? Whatever the solution I'll be happy to document and post back for others. (I've tried the jQuery route but would prefer a server-side solution for better accessibility in case of JS not working/being present)

Thanks for the help-

Jason

Comments

quicksketch’s picture

I generally do not help with custom coding questions, but you might take a look at the code base of Webform Pay, which does pretty close to the same thing by tallying up all the submission values and setting the value of another field.

jpamental’s picture

Thanks a bunch - I wasn't expecting you to weigh in but figured it was a good community question. That's actually just what I'm trying now as this form is using Webform Pay (it's a tuition payment form). I actually learned about that in the Webform 3 session at DrupalCon Chicago - thanks for all the great work on this!

Cheers,

Jason

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of activity.