What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Extracting Quantity Bought From Stripe Widget

    Asked by BxClinic on November 22, 2016 at 05:00 PM

    Hi there,

    I have a form which uses Stripe payments widget, where visitors will be able to buy a quantity of a product (from 1-6). This number represents the number of tickets they are buying.

     

    When they submit the form, I'd like to send them an email which has a link to another form.

    This second form asks for the name of the visitors, and if they originally said they'd like 4 tickets, it'll have 4 rows containing these fields:

    Name

    Phone Number

    Email Address

    Dietary Requirements etc

     

    I don't know how to get the quantity from the Stripe widget. I assume when that's done I could prepopulate the second form. Could you give me some suggestions please?

    Many thanks

    James

     

    quantity name phone number product
  • Profile Image
    JotForm Support

    Answered by Jim_R on November 22, 2016 at 07:41 PM

    Hi James, since there's no innate way to grab the selection from the dropdown menu of the product on your Stripe Payment field, I'm thinking adding fields that will temporarily hold that info before passing it to another form would be the key.

    I'm currently fiddling around with an example form that you can test with and I'll get back to you on this thread once I have some results.

  • Profile Image
    JotForm Support

    Answered by Jim_R on November 22, 2016 at 08:09 PM

    All right, we'd need 2 additional Textboxes that will house the value of the dropdown that will be passed to the next form (these can be hidden but I have them displayed for testing purposes).

    1. First textbox named Temp will get the value of the product (this is the only output of the Stripe field)

    2. Then another textbox named To be passed that will conditionally set a value of 1-6 depending on what was fetched from the Stripe payment field

    Here are the conditions:

    Here, we're just getting the value of the selected product from Stripe (e.g. the value may be 150.00, 300.00, 570.00 and so on depending on the number of Tickets selected).

    Once we have that value, we'll create 6 conditions for each. For testing purposes, I only created 1 condition that will match your post, which is for 4 tickets.

    Here, IF TEMP is EQUAL TO 570.00 THEN DO To be passed = 4.

    Now that we have a reference on how many tickets were selected on the payment field, we can now proceed on passing that value to another form.

    To achieve that, set your Form 1's Thank You page to redirect to your Form 2 using this prepopulated URL:

    https://jotform.com/63267784965979?prepopulatedFrom={toBe}

    (where toBe is the field name of the textbox from Form 1 and prepopulatedFrom is the textbox on Form 2 that will get the value passed)

    Related guide: Redirecting-Users-to-a-Different-Page

    Once done, go to Form 2 and create a textbox that will get the value being passed. In my case, I added a textbox named Prepopulated from previous form (and the field's name is prepopulatedFrom).

    RESULT:

    Form 1: https://jotform.com/63267664643969

    Form 2: https://jotform.com/63267784965979

    Related guide: How-to-Automatically-Pass-Form-Data-to-Another-Form

    Now you're free to do your own logic on how you want Form 2 to display depending on the value of the prepopulated textbox.

  • Profile Image

    Answered by BxClinic on November 23, 2016 at 05:14 AM

    Jim,

    You guys are consistently AMAZING!

    I've followed and implemented your suggestion, and am so happy.

    Rather than sending the variable to prepopulate a second form immediately, I'm generating a URL which will be sent by an autoresponder one day after the first form is complete. That way, they get an email immediately thanking them for their purchase, and another email the next day asking them for the names of the people coming.

    I'm so happy that I found Jotform - it's been at least 5 years I've been a user and I send sincere best wishes to you all - you work for an amazing company, and your amazing support makes the company even greater!

     

  • Profile Image
    JotForm Support

    Answered by Kiran on November 23, 2016 at 06:04 AM

    That's great!! Glad you are so happy with our service. The feedback that you have provided really boosts our energy levels to give even more quality support. Please do not hesitate to get back to us if you need any further assistance. We will be happy to help.

    Thank you for using JotForm!