If I have two number boxes, is there a way to calculate the product in a 3rd box?

  • Profile Image
    jolizzy
    Asked on March 06, 2012 at 01:19 PM

    This will be used to calculate total pledge for a swimming event.  E.G. Pledge amount X # of lengths swum = Total Pledge.

    We will bill directly from Paypal after the event, so don't need payment options.

  • Profile Image
    gori-mathew
    Answered on March 06, 2012 at 02:13 PM

    Hi jolizzy;

    Your question can be nswered using the following link of previous asked question of calculation three fields http://www.jotform.com/answers/67402-calculating-based-on-three-fields

    Kindly have a look at the feaute and hope it will assist yiu.

    Best Regards

    Mathew

  • Profile Image
    jolizzy
    Answered on March 06, 2012 at 02:31 PM

    Thank you--the payment tool requires a price to be defined, and the user needs to be able to set his own dollar amount.

  • Profile Image
    fxr
    Answered on March 06, 2012 at 05:15 PM

    hello jolizzy,

    There is no way at this time to allow form users to fill in their own value into a field and have calculations carried out based on it. 

    You may be able to approximate this functionality to a certain extent by having pre-defined values from which the form user can select e.g 1, 2, 3, 4, 5, 10 , 15 USD.. etc then building up the total from that. 

    --

    The only way to get exactly what you are looking for is embed the forms full source code onto a page on your webserver and asking us to provide some bespoke javascript that will do the calculation. 

  • Profile Image
    abajan
    Answered on March 07, 2012 at 12:53 PM

    @jolizzy

    Is the form on this page the sort of thing you wanted? Submit it and have a look at the the auto-response. The submission records (of which you would not be privy to because it's not your form) do not contain the "$" symbol, as I figured it might interfere with calculations in some instances. However, a few adjustments can be made to the script to have it included there as well as in the email alerts.

    I don't know how familiar you are with JavaScript but if this solution would be suitable for your purpose, we'll be glad to help.

  • Profile Image
    jolizzy
    Answered on March 08, 2012 at 12:51 PM

    Beauty!  That's exactly what I need.  I don't know JavaScript at all, unfortunately.

    I have to say, so far I am very impressed with your service.  If we can get this to work, you people are going to make me look really good! :)

  • Profile Image
    jolizzy
    Answered on March 08, 2012 at 12:58 PM

    I used validation to enable numeric only in the pledge amount text box.  If you can walk me through the Java, I would be grateful.

  • Profile Image
    fxr
    Answered on March 08, 2012 at 03:08 PM

    @jolizzy

    We will leave this one in abajans' more than capable hands, I am sure he will get back to you when he comes back on duty.

  • Profile Image
    abajan
    Answered on March 09, 2012 at 02:17 AM

    @jolizzy

    JavaScript is actually fxr's forte! Nevertheless, I will help you as best as I can but in the morning (as in "when the sun rises" because it's actually already morning here or ridiculously late, depending on how one looks at it, and I really need to catch some "ZZZs", if you please).

    Good Night.

  • Profile Image
    abajan
    Answered on March 10, 2012 at 03:53 AM

    @jolizzy

    I haven't overslept or forgotten you! I got the solution to work in your form but I'm just trying to tidy up a few things in the code. I'll post the instructions here later today (Barbados time).

  • Profile Image
    jolizzy
    Answered on March 10, 2012 at 04:09 PM

    Abajan,  Thank you!  I appreciate your attention to this!

  • Profile Image
    gori-mathew
    Answered on March 10, 2012 at 04:24 PM

    Hello

    Welcome and thanks for your appreciation and complements to our team especially Abajan, we feel great to hear that your were assisted.

    Regards

    Mathew

  • Profile Image
    abajan
    Answered on March 12, 2012 at 04:24 PM

    Hi again jolizzy

    Do some submissions on this form and let me know if it's okay. If it is, I'll guide you as to what steps should be taken to implement the solution on your end.

    Initially, when I stated that I got the solution to work in your form, I misspoke, as I was to later discover that it had a bit more complexity than I had earlier thought. (It probably has way more JavaScript than necessary but from what I can tell, it does the job.)

    We look forward to hearing from you.


    Wayne

  • Profile Image
    jolizzy
    Answered on March 14, 2012 at 02:03 PM

    Wayne, That looks great!  The submissions seemed to work on my end... but of course, since they dumped the results into the report for your cloned form, I can't see them.  I have about 2 weeks from today before this form has to go live.  I'm looking forward to implementing your solution!

    Once that's done, I'm sure I will think of a hundred more ways I can make this form easier to use! :) (Read--100 more ways I can think of to make the code more complex!) 

  • Profile Image
    jolizzy
    Answered on March 14, 2012 at 03:32 PM

    Ah, here's another question already:  once the amount is calculated in that field, can it automatically be plugged into a paypal payment field?  The paypal field would only be visible if the user selected "now" in the "When processed" field.

    If "After event" is selected, the user would receive an email with a payment request after the event is completed.

  • Profile Image
    pinoytech
    Answered on March 14, 2012 at 04:17 PM

    Yes, it posible to make condition that if the user choose "NOW" the paypal field would be visible.

    I clone your form and create the condition that you want. Please take a look on this link

    http://www.jotform.me/form/20736603019448?

     

  • Profile Image
    jolizzy
    Answered on March 14, 2012 at 05:15 PM

    Oh, I see.  If "NOW" is selected, then the paypal payment field shows; if "After event" is selected then the calc field that Wayne is working on shows.  Cool!

  • Profile Image
    jolizzy
    Answered on March 14, 2012 at 05:19 PM

    How did you add the "Payment method" info and payment logos under the pledge amount box?

  • Profile Image
    pinoytech
    Answered on March 14, 2012 at 06:07 PM

    Hi,

    Kindly check your form now, I already added the Payment tools into your form and make condition that if the user choose "NOW" the paypal field would be visible.

    http://www.jotform.us/form/20654907888165

    If need further assistance, contact us anytime.

  • Profile Image
    jolizzy
    Answered on March 14, 2012 at 07:22 PM

    When the "credit card" radio button is checked, a whole name/address section of the form shows up for Paypal.  Does the info there also get collected into my data file? 

    Also, I looked at the properties of that field, and there is a space for API Username and Password.  Will this work for a regular Paypal account, or is it only for use with Payments Pro?  I don't have any control over whether the organization subscribes to that service.

    Thank you.

  • Profile Image
    mliz
    Answered on March 14, 2012 at 11:05 PM

    We do not store the credit card information we only pass it securely to PayPal Website Payment Pro API for processing. You can find the payer information in your Paypal account. The API details is only available in Paypal Pro if you use a regular Paypal account you can use regular Paypal payment field which uses website payment standard integration.

    Cheers!

  • Profile Image
    jolizzy
    Answered on March 15, 2012 at 06:58 PM

    Hi Wayne, I'm still looking forward to seeing your solution!  :)

  • Profile Image
    abajan
    Answered on March 15, 2012 at 10:06 PM

    Hi jolizzy

    I was just waiting until you had decided on the final format and functionality for the form. For example, the last time I checked, a "PayPal Pro" field was shown when "Now (fixed amount only)" was chosen in the "When would you like your pledge processed" field. Now I'm seeing something different.

    I just want to have a clear picture of how all of the conditions in the form are to work before providing a solution. For instance, is something to happen on the form when the user chooses different payment methods or is that just information that will appear in the notification?

    Incidentally, after just cloning the latest version of the form I noticed a duplicated condition:

    (Click images to zoom)

     
    Also, although it won't affect the functionality of the form, the following rules could have been combined in one condition by using the Add New Rule button (subsequent screenshot)

    (Correction: The third rule alluded to in the screenshot above is actually a duplicate of the first rule and should therefore be deleted and not included in the condition below)

  • Profile Image
    jolizzy1
    Answered on March 19, 2012 at 02:40 PM

    Hi Wayne, I accidentally went over my SSL limit while testing my form, so I cloned it to a new account.  I have tried to clean up my rules as per your instructions above--hope I got everything!  I will have to clone the forms one more time, to the pool's account.  Would it be better to wait until I have done that before implementing your solution? 

    Hope it's a lovely day in Barbados... we have snow!  Finally!

  • Profile Image
    abajan
    Answered on March 19, 2012 at 11:22 PM

    Hi jolizzy1

    Some things need to be cleared up in the form before we can start dealing with adding JavaScript to the source:

    If a drop down has been set to "Required", it should be blank when the page loads. Otherwise, users would be able to submit the form without any selection being made in that field. Therefore, "Please select" should be removed from the When would you like your pledge processed? field. The same applies to the If swimmer is unable to swim, field. The Pledge type field should be set in a similar fashion: "Required" and blank by default. Alternatively, each of those drop downs can be set to load with a default choice and the "Required" setting removed. So, in a nutshell, if a drop down is set to "Required", it should load with nothing selected and conversely, if a drop down is set to display a selection when the page loads, the "Required" setting should be removed.

    Regarding the "Payment method" field, since the PayPal page has no option to pay by check, what happens if a user elects to pay by that method? (Regardless of what choices are made on the form, the PayPal payment page is always displayed after submission.)

    After giving this much thought, I'm starting to wonder if it wouldn't be better to remove the current Total pledge field and rename the Donation field "Total pledge" (The "Donation" sub-label can be hidden with injected CSS). However, I'm not sure how feasible it would be to set that field to be editable under some circumstances and readonly under other conditions. So that bit of functionality may have to be omitted. Also, that field should be set to "Required" since you wouldn't want the form to be submitted without a pledge!


    The Conditions Wizard

    There's something regarding "Show/Hide" conditions about which you may not be aware: When a field is set to be shown under certain conditions, once those conditions are not met, it will be hidden. So, it's not necessary to specify any rules to hide the said field:

    (The "HIDE Donation field" rule is unnecessary)


    Lastly, the following rule is unnecessary because it already exists in the last condition:

    If the condition below is clicked while in the Conditions Wizard, you'll see that it already contains the above rule. So, the above rule is unnecesary.


    That's all for now. As to the weather, it was quite nice here today. Glad you got some snow!

  • Profile Image
    jolizzy1
    Answered on March 20, 2012 at 12:10 AM

    Hi Wayne,

    Whew!  So much information!  Those conditionals get confusing.  Ok, I have removed the duplicate conditions and removed the default answers in required fields.

    Regarding the "Payment Method" field, if "When would you like your pledge to be processed" = "NOW", the payment method field is hidden and the paypal field is shown, so that they can complete their donation NOW.

    If "When would..." = "After event", then the "Total Pledge" field will show, and based on the payment type field we will either email a request for payment of the amount calculated in the "Total Pledge" field (if the selected type is check), or we will send an invoice directly from paypal (if credit or paypal is selected as the payment type).

    Does that make sense?

  • Profile Image
    abajan
    Answered on March 20, 2012 at 06:59 AM

    RE: Paragraph 1

    Pledge Type should be set to "Required" so that the script would know if to factor the number of lengths swum into the total pledge. If it becomes hidden due to a user selecting "Now (fixed amount only)", it will no longer be a required field.

    ---------------------------------------------------------------------

    RE: Paragraph 2

    As to the Payment method field being hidden when "Now (fixed amount only)" is chosen, that was understood but if that option is selected and the user forgets to enter a donation amount before submitting the form, we don't want the following to happen on the PayPal page:

    Setting the field currently labeled Donation to "Required" would prevent the user from submitting the form in the first place.

    ---------------------------------------------------------------------

    RE: Paragraph 3

    Knowing that upon submission the PayPal page would load (regardless of what choices were selected on the form), I was wondering what a user who had chosen to pay by check would do when they got to the PayPal page:


    Lastly, I had suggested that the Total Pledge isn't really necessary and that the Donation field could be renamed "Total Pledge".

  • Profile Image
    jolizzy1
    Answered on March 20, 2012 at 05:25 PM

    Hi Wayne,

    RE: 1 & 2, I corrected them as you sugggested.

    RE: 3, The paypal field is only available if "Pay Now" is selected.  When the form is submitted with "Pay Now", it redirects to the paypal page. BTW, the pool doesn't have paypal pro, so we won't be using the API, just the regular paypal field.  I'm considering having the address field hide for "Pay Now" so that the user only has to enter the info in paypal.

    If "Pay After Event" is selected, the paypal field hides, and the "Pledge amount" and "Lengths" fields will show, along with the "Total Pledge", which would be the calculated field.  If "After event" is selected, then regardless of the pledge type ("Fixed Amount" or "Per Length Amount"), after submission the user will be directed to a thank you page.  After the event we will send emails (if check is selected) or paypal invoices (if paypal or credit is selected), according to the payment type selected. 

    So, the only time the paypal field is used is if the user opts to "Pay Now".  That is why the paypal field is set to hide if the user selects to pay "After event"--so that it doesn't send them to paypal when they don't need it.

    You can try the form as it is now and see how the paypal field works--mine works as described above.  It will just open the paypal page, but it won't create a record in paypal until you submit a payment... just don't pay me, 'cause I won't pay you back! :-P

  • Profile Image
    abajan
    Answered on March 20, 2012 at 07:41 PM

    LOL!

    Wherever did I get the idea that the PayPal page would "load after submission regardless of what choices were made on the form" from? The conditions you set up clearly showed that that would not happen and sure enough, after I just cloned the form and ran a test submission with "After event" selected in the When would you like your pledge processed? field, the following message was shown (as it should)

    I'm sure your form is working as it should. I think I must have been trying to overanalyze it or something! Perhaps I need to step away from the form and come back to it in a couple days time :)

  • Profile Image
    jolizzy1
    Answered on March 20, 2012 at 09:31 PM

    Take a brain break!  See you in a couple of days. :)

  • Profile Image
    jolizzy1
    Answered on March 26, 2012 at 12:11 PM

    Hi Wayne,

    I had a busy several days, but I'm back!  This was suppposed to go live on Wednesday, but it looks like we have another couple of days, because I haven't gotten the confirmation I needed on another part of the event.

    So, what needs to happen here? 

    Thanks in advance.

  • Profile Image
    jolizzy1
    Answered on March 26, 2012 at 01:17 PM

    Hi again,

    Ok, a couple of questions...

    Before you give me the calc solution, do you want me to clone these forms into the pool's account?

    The autorespond generates a link for swimmers to send to their potential donors, including the lengths they expect to swim.  HOWEVER, will having the length info automatically plug into the donate form mess up the way the calc field works?  I can take that out if you need me to.

    Thanks.

  • Profile Image
    abajan
    Answered on March 26, 2012 at 06:22 PM

    Hi jolizzy

    Before cloning the forms into the pool's account, let me run some tests to see how everything would work. To be honest, I don't know if prepopulated lengths will factor into calculations. It may well be that the script that performs the calculation may only work if information is input manually. It's not a question of if prepopulation will mess up anything but rather if values entered in such a manner will factor into the calculations. But my tests tonight will prove whether they would or not.

    I'll get back to you in the morning.


    ~ Wayne

  • Profile Image
    abajan
    Answered on March 27, 2012 at 06:19 AM

    Just a quick update:

    A test I ran showed that prepopulated lengths will be factored into calculations just like those which are manually inserted. This was my main concern.

    I'll keep you posted.

  • Profile Image
    jolizzy1
    Answered on April 04, 2012 at 08:11 PM

    Hi Wayne,

    The week has flown by... and now the form is supposed to go live tomorrow!  YIKES!  Any news about that calculation?  We can lose the prepopulated length field if it mucks things up.

    I think the issue is not so much whether prepopulated fields factor into calculations, but whether they mess with the calculation if someone selects fixed amount instead.  In other words, if the lengths field is hidden when someone selects "fixed" pledge type, will the amount they enter in "Pledge amount" still be multiplied by the (hidden) prepopulated value in "lengths"? 

    Thanks.

  • Profile Image
    jolizzy1
    Answered on April 04, 2012 at 08:30 PM

    BTW, the swimmer registration form is already live--I forgot to clone it to the swim team's account before I sent it out.  For simplicity's sake, I'll use both forms in my account--note to self: remember to use the swim team's account next time!

  • Profile Image
    abajan
    Answered on April 04, 2012 at 09:32 PM

    Hi Jolizzy

    Yes, time appears to have run away from both of us! Anyway, go to http://www.jotform.co/form/20863308219857, complete and submit the form, test the links in the autoresponder, complete the pledge form as many times as you deem necessary to be assured that every thing is working properly. (I've set the notifications to go to your jolizzy address instead of the foresthillpool one. If you prefer that they be sent to the second one instead, let me know.)

    After you have completed the tests, I'll roll back your submission count to its current number.


    ~ Wayne

  • Profile Image
    abajan
    Answered on April 04, 2012 at 09:38 PM

    LOL

    Actually, I just realized that those submissions will be recorded in my account, not yours! So, there will be no need for me to rollback anything.

  • Profile Image
    jolizzy1
    Answered on April 04, 2012 at 09:40 PM

    Ohh, I like your background! :)

    And, excellent on the add a new swimmer link in the thank you page!  I didn't know you could do that--much more elegant than my solution!

    Please continue sending responses to j0lizzy--I don't have access to the Foresthillpool address.

  • Profile Image
    jolizzy1
    Answered on April 04, 2012 at 09:46 PM

    Ok, the registration page looks good.  Now for the calc field in the Pledge form.

    Unfortunately, I am on my way to a pool board meeting right now, so will have to finish this up either tonight or tomorrow morning.

    See you later!

  • Profile Image
    jolizzy1
    Answered on April 05, 2012 at 12:11 PM

    Hello Wayne,

    I have an hour or so right now, so I hope you're available!  What needs to happen with that calc field?  I'm about to send the link out to the registrants I have so far, so if we can get that set up before they need to use it, I would be grateful.

  • Profile Image
    plongeon
    Answered on July 16, 2012 at 02:51 PM

    Hello Wayne,

    What you posted on March 7 is exactly what I need but I did not find any way to integrate JavaScript in my form. When I insert <script> tags in custom HTML it is removed. How did you do that?

    Louis

  • Profile Image
    NeilVicente
    Answered on July 16, 2012 at 06:22 PM

    @plongeon

    Wayne's solution require modification of the form's source codes and embedding it to an external server. Obviously, JotForm does not allow custom scripts to be saved using the Free Text tool (for security reasons).

    Hence, the only way to make this work is to have the modified codes embedded on an externally-hosted webpage.

  • Profile Image
    plongeon
    Answered on July 18, 2012 at 12:24 PM

    @NeilVicente

    Thank you for the answer. That is what I expected... unfortunately.

    Why don't you allow the insertion of <script> tags in Custom HTML fields? It would open so much possibilities.

    Louis

     

  • Profile Image
    abajan
    Answered on July 18, 2012 at 02:36 PM

    Unfortunately, it would also open so many vulnerabilities and we simply can't risk that.