jquery – Dynamically change “total” input field based on selections gravity forms
I am working on a website for a client, they offer tours to and from different locations. One of the features they want is a form to request a “transfer” from one location to another, and for the user to be able to process a payment for the transfer with the form submission. An example can be viewed here: https://www.wheelzniagara.com/transfers
I’ve built a Gravity Form with all of the different drop-off/destination options and integrated the Paypal add-on for the payment processing part.
The issue I’m having is finding a way to dynamically set the price the user will end up paying. The pricing is dependent on the number of people participating in the “transfer” (1 – 11, if it is over 6 they need 2 vehicles and the price doubles), where the pick-up location is, and where the drop-off location is.
The sheer number of price variations is a little staggering, our calculation put it at about 680 different price variations, so trying to use the conditional logic options within gravity forms is not a viable option.
What I would like to do is use jQuery to dynamically set the total of the form based on the selections the user has made. I.E. set a base price for each pick-up/destination then add/multiple the cost based on the number of participants.
I am having trouble even changing the value of the total input field that the GF Paypal add-on inserted. It appears to be a read-only input and jQuery does not seem to be able to alter the value. Even if I can get it to alter the value, I am wondering if it will even be registered with PayPal as the price that needs to be paid?
I am hoping this is possible with Gravity Forms, I would like to avoid creating my own form, a template to house it, and worrying about security protocols that are very real with this type of payment processing form.
Any help, insight, suggestions would be very much appreciated. I would be happy to provide additional details or clarifications as well.
Thanks for looking,