-
standupAsked on May 24, 2022 at 3:55 AM
How do I multiply number of guests field with number of nights staying field to generate a total price?
I'm using the My Products field for number of guests wanting to stay, but I can't add a multiplyer to this for number of nights they want to stay.
Is there a way to do this?
thanks
-
Rica Support Team LeadReplied on May 24, 2022 at 4:40 AM
Hello standup,
Thanks for reaching out to Jotform Support. I believe you are referring to the Hotel Reservation Form. What I would suggest to achieve your requirement is:
1. Add a hidden Form Calculation widget to calculate the number of nights that the guest is staying using the dates added on the Arrival and Departure field.
2. Instead of adding the product to the Product List, use a Multiple Choice element to list the products and assign a Calculation Value.
3. Add another hidden Form Calculation widget to calculate the Total. The formula should be (Products * Number of Guest) * Number of nights.
4. On the Product List, change the Payment Type to User Defined Amount.
5. And then set the Get Price From Total field.
You may test this workaround using this demo form. I have not hidden the Number of nights field and Total field for testing purposes.
Let us know if there’s anything else we can help you with.