Responsive prices

Hey everyone! I was wondering if anyone managed to create a responsive price to a user input.

For example, if one creates a user input form asking a particular question, like: “where are you from?”. You would then receive an answer like “France”, “Italy” and etc. Could you then use this information to determine a price so that when the form is complete, a user would see a confirmation page saying: “Dear user…bla bla bla… price is $100 (if you chose France) and $110 (if you chose Italy)”. Click here to pay.

Perhaps it is possible to do using the html code for Paypal buttons, but then I’m not sure how to make the price responsive.

Let me know what you guys think about it)

I found this reply and although I haven’t tried this just yet, it seems to be exactly what I need. However, I’m not sure how to incorporate this to a Paypal button.