-
johneffAsked on May 12, 2014 at 12:02 PM
I would like to be able to choose one of three different items, each with a different price then based on that, branch to a PayPal submit using the chosen item and price.
And, when the PayPal submit is complete, send the entire form plus payment information in one email.
Thanks in advance for the help.
John.
Page URL: http://njfoodsafe.com/registration.html -
TitusNReplied on May 12, 2014 at 3:22 PM
Hello John,
From your question - it looks you want to include the workflow of selections into the paypal integration -
1. whatever the user selects, the paypal field is automatically updated and the form user is charged the appropriate amount
2. The amount is paid through paypal
3. You get an update of the purchase via an email notification.
Kindly test this form - does it work as you would expect?
https://shots.jotform.com/titus/copytotal.html
Its a copy of your form with a few modifications (please make a copy of your form and use the copy/clone to implement this workaround to protect the data you have on the form):
1. Associate calculation values with the three "Select Class (Choose One)" options as shown
2. Add a calculation field on the form that collects the selected value from the "Select Class (Choose One)"field:
With the following calculation setting:
That will calculate a result based on what the user selects.
Next, edit the paypal field as follows:
This will create a cutom payment box that will be used to update the paypal total.
The next part will be a little technical, it involves some minor javascriptDISABLED:
1. Get the source code of your form
2. Place the form's source code inside the <body></body> tags of a standard HTML document structure
3. Add the following script just before the </form> tag:
<script type="text/javascript">
function copy_value(form_total)
{
document.getElementById('input_36_donation').value=form_total;
}
</script>4. Add the following attribute (highlighted blue) to the input field identified by id#input_63 - I know this is getting a little complicated, but that is the last step - here is an excerpt from the source code of how the attribute looks:
</li>
<li class="form-line" id="id_63">
<label class="form-label-left" id="label_63" for="input_63"> Total </label>
<div id="cid_63" class="form-input">
<input type="text" class="form-textbox" data-type="input-textbox" id="input_63" onDISABLEDkeyup="copy_value(this.value);"name="q63_total63" value="0" size="20" />
</div>
</li>Here is the source code with a copy of your form: http://pastebin.com/AkkguyuE
If you like how the solution works - please let us know, and we can prepare the source code that you need to implement that on your form, and how to add it to your website.
Please let us know.
-
TitusNReplied on May 12, 2014 at 3:27 PM
FYI - the test form with this solution leads to a real paypal account for the purposes of demonstrations and tests - please do not make any payments.
-
johneffReplied on May 12, 2014 at 9:11 PMThanks!
Appears to work as expected, although I haven’t tried to submit a form to PayPal.
... -
TitusNReplied on May 13, 2014 at 2:44 AM
Hello,
Upon review and guidance from our developers- This will work better, and its easy to implement without the script I provided - its a newly released feature:
Skip the last four steps on my guide and do the following:
- On the paypal integration, change the value of the "copy from" drop-down to "Total"
The "Total" field is the form calculation widget we added in the first guide - the only thing different with this method is that there are no customized scripts to configure.
Click next and save your settings.
Here is a test form with this setting: http://form.jotformpro.com/form/41315443313948
Try it out and let us know.