PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Donation fields

  1. rayne
    Member

    I need to be able to create a donation form that has both radio button choices ($35, $50, etc) and a blank line so an amount can be entered. Do I create two fields and send either to Paypal (if so, how?) or is there another way to do this. I am using Gravity forms Version 1.5.rc3.2 and Gravity Forms PayPal Add-On Version 1.0.beta5.
    Thank you

    Posted 13 years ago on Monday February 14, 2011 | Permalink
  2. rayne
    Member

    Is there a way to have a pricing field / donation that has both radio button choices ($35, $50, etc) and a blank field so an amount can be entered? If not, is there a work around to do this?
    Thanks.

    Posted 13 years ago on Thursday February 17, 2011 | Permalink
  3. This will be possible, but the current 1.5 release of Gravity Forms has a bug in the Donation field so only the User Input is currently working properly. We will be fixing the Multiple Choice and Dropdown options in the next development release. You will see if you try and use them that they don't have Price options.

    When we release an update it will fix this bug and make them usable. When that happens you could set it up that way.

    You'd create a Multiple Choice donation field and make the last option say "Other" and give it a price of $0.00.

    You'd then create a User Input donation field and use conditional logic to show it if the first donation field is set to Other.

    But until we fix the Donation field in the next release you won't be able to do the above. You can only use it as a user input field right now.

    Please note the donation field is specifically designed to be used with the PayPal Add-On and PayPal only allows for one Donation field to be passed to it. It's not like Products where you can pass multiple Products. You don't select which Donation field to send to PayPal, the Add-On assumes the Donation field that has been selected is the one that should be passed since there should only be one that is populated.

    Posted 13 years ago on Thursday February 17, 2011 | Permalink
  4. reelseo
    Member

    Is there a way with the new paypal integration - when adding a donation field, and choosing "user definied price" to have the field be more obvious that it's looking for a number/currency?

    Posted 13 years ago on Tuesday April 12, 2011 | Permalink
  5. You could use the description field. Or populate a default value. Right now those would be the only two options.

    Posted 13 years ago on Wednesday April 13, 2011 | Permalink
  6. I am using the above mentioned solution to add a user defined amount to a multiple choice donation form via conditional statement enabled but if I have the form selected to required as a rule it errors. Is there a way to fix this. I am trying to make sure a person has in fact entered either a multiple choice amount or a user defined amount into the form before submitting it.

    Hope this makes sense. Many thanks to any and all that take the time to reply. New to GF but loving what you guys have done to make this sooo much of an easier, and quicker thing to do.

    FM

    Posted 13 years ago on Sunday May 22, 2011 | Permalink
  7. Which field do you have the Required rule assigned to? The Multiple Choice or the User Defined Price?

    In this case you'd make the User Defined Price field the required field and the Multiple Choice NOT required. You'd then edit the Multiple Choice field and set one of the options as the default value by selecting the radio button next to the choice you want to make the default when editing the field (see this screenshot: http://grab.by/acbe)

    Then make the User Defined price field required.

    Doing this will mean one of the Multiple Choices will already be selected, and if the user chooses to select Other then the User Defined Price will be required. So they will have made a selection either way.

    Posted 13 years ago on Monday May 23, 2011 | Permalink
  8. I'm working on something like this, but with product fields for monthly recurring subscriptions. It's not clear to that this is even possible, but I want to provide a range of values along with an "other" value where the user could enter an amount. I think I have the logic worked out, but the subscription type of form only lets you send one amount to PayPal.

    Also, what causes the the wrapper to have a style that prevents the form from appearing?

    <div class='gform_wrapper' id='gform_wrapper_2' style='display:none'>

    Posted 13 years ago on Wednesday June 1, 2011 | Permalink
  9. Hi fastpipe,

    ...but I want to provide a range of values along with an "other" value where the user could enter an amount.

    As you mentioned, the subscription feed requires that only one field be used as the subscription amount. I do not think this will be possible without custom code.

    Conceputally, you could create an additional user defined price field, hide it with CSS, and automatically populate the price in this field every time a change was made to one of the subscription fields. Here is a related topic where this method was used to add a surcharge:

    http://www.gravityhelp.com/forums/topic/add-surcharge-to-the-total-on-form#post-21670

    Posted 13 years ago on Wednesday June 1, 2011 | Permalink
  10. I think you have the right idea in terms of what I'm trying to accomplish. So, effectively, I'd like to have one hidden via CSS field, a product field on the monthly subscription form and a donation field on the one-time donation form, containing the amount that gets submitted to PayPal. Those fields would be required.

    On each of those forms, there would a set radio buttons containing amounts, $20, $10, other. When you click $20, it sets the required hidden via CSS field, to 20, when you click $10, it sets it to $10, and when you click Other, it displays the hidden field and changes the focus to it. The hiding/showing when other is clicked is taken care of the conditional logic, but I'm not quite sure how to set the value of the hidden field when the amounts are changed. It shouldn't be all that complicated, but I haven't found a good example yet. I looked for a hook that would allow me to override gf_apply_rules, but I don't see an easy way to do that either.

    Also, I figured out that I had overrode the GF javascripts in the header of my theme, which is why my form wasn't displaying with the conditional stuff turned on.

    Posted 13 years ago on Friday June 3, 2011 | Permalink
  11. Hi fastpipe,

    If you take a peek at the code snippet in the post I linked to you'll see how I automatically update the value of the hidden field using some custom javascript.

    There is no default way to do this in Gravity Forms so it will require some custom code and little familiarity/learning with javascript. :)

    Posted 13 years ago on Friday June 3, 2011 | Permalink
  12. I've been working off of that and have a script that works on a simple form containing just the two blocks with the radio buttons and the "hidden" field:

    <script>
    	jQuery(".amounts input[type='radio']").change( function() {
    	  var str = "";
    	  jQuery(".amounts input:radio:checked").each(function () {
    			str += jQuery('.amounts input:radio:checked').val();
    	});
    	if(str != 'Other|'){
    	  jQuery(".donation").css("display","none");
    	  var partsArray = str.split('|');
    	  var newamount = partsArray[1] + ".00";
    	  jQuery(".donation input").val(newamount);
    	} else {
    	  jQuery(".donation").css("display","block");
    	}
    	})
    	.change();
    </script>

    I have a custom CSS class for the radio buttons called "amounts" and one for the hidden field called "donations". When you choose a number, it populates the donation field with the amount and hides it; when you choose "Other" it shows the donation field. Works exactly like I want on a simple form with just those two fields, but doesn't work at all on the entire form. I'm pulling my hair out over this one 'cause there must be a conflict, but I can't seem to find it.

    Posted 13 years ago on Friday June 3, 2011 | Permalink
  13. Could you post a link to this script implement on the full form?

    Posted 13 years ago on Friday June 3, 2011 | Permalink
  14. Sorry for not getting back to you sooner. I was headed out for a much-needed few days of R&R. Here's the static page I've been using to test the script...

    http://www.fastpipe.com/media/field-change.html

    The part that's visible works exactly as I want; the full form is in the source and commented out and that's where it doesn't work.

    Thanks for any help you can offer...

    Posted 13 years ago on Friday June 10, 2011 | Permalink
  15. Hi FastPipe,

    Unfortunately, I've lead you astray. I misunderstood your original request and did not realize that the donation was to be processed as a one time fee. This complicates the issue beyond a javascript solution and would necessitate a more invovled PHP solution to dynamically update the PayPal feed from a subscription to a product transaction.

    The only other "front end" solution would be to load two unique forms. One configured with a subscription PayPal feed the other with a product & services PayPal feed. The subscription form would be displayed by default, the other would be hidden with CSS. When the "other" option is selected on the subscription form, you could use javascript to hide the subscription from completely and in it's place show the donation form.

    This solution would not be much harder than what you're currently attempting... so maybe worth a shot. Sorry for any of your time wasted by the misunderstanding.

    Posted 13 years ago on Saturday June 11, 2011 | Permalink
  16. I think you understand what I have in mind and I am using two different forms, one for a recurring subscription charge and one for one-time donations. Using two different forms isn't a big deal, but I do want to suggest some amounts and then offer an "other" option for each form. The forms without the other option are at:

    Subscription:
    http://thisibelieve.org/support/

    Donation:
    http://thisibelieve.org/support/donate/

    The static form I uploaded has one of the forms. It works so long as I just include the two fields and not the entire form. The javascript problem I have is probably a selector issue, but I just can't seem to figure it out.

    Posted 13 years ago on Monday June 13, 2011 | Permalink
  17. @fastpipe If you want to have a Donation Form that asks the user to select from some pre-defined donation amount and then has an "Other" option where they enter their own amount this is simple to do.

    - Add a Donation Field to your form
    - Configure it's field type to be multiple choice radio button
    - Add your pre-defined donation options
    - Make the last option say "Other"
    - Check the "Enable Values" checkbox above the radio button choices
    - For the "Other" choice leave the value blank/empty
    - Select the radio button next to your first choice to pre-define it as the default value
    - Add another Donation Field to your form
    - Edit this Donation Field
    - Configure it's field type to be user defined value
    - Make it a required field
    - Select the Advanced Tab
    - Use Conditional Logic to show this field only if the first Donation Field is Other
    - Save your form

    DON'T make the first Donation Field with the radio buttons required. Since you have pre-selected the first radio button choice as the default value the user will have always made a choice and since you made the 2nd Donation Field required if the user chooses "Other" they would have to enter a value in the 2nd Donation Field that is displayed via conditional logic.

    Posted 13 years ago on Monday June 13, 2011 | Permalink
  18. @carl, but will that solution work for recurring donations?

    Posted 13 years ago on Wednesday June 15, 2011 | Permalink
  19. I'm going to try this out tomorrow, but instead of a donation field, on the form for recurring donations, if I just make subscription fields instead of donation fields, that should work, right? My javascript actually works, but just not when the form is all put together.

    Also, just an observation, but I've noticed that multiple choice donation fields and multiple choice subscription fields have different CSS. With the donation fields, the radio buttons appear horizontal and with the subscription fields, the radio buttons appear vertical. Shouldn't they be the same?

    Posted 13 years ago on Wednesday June 15, 2011 | Permalink
  20. @dwenaus If you want a recurring payment you need to use the recurring/subscription payment type when configuring your PayPal Feed using the PayPal Add-On... which does not use the Donation field type. You'd have to use the Product Field instead. You can configure the Product Field so it functions the same way as I described above.

    Posted 13 years ago on Wednesday June 15, 2011 | Permalink