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.

Authorize.net - Hide when total is $0

  1. Is there a way to conditionally hide the Authorize.net payment field if the total is $0? I saw this post from a few months ago but it doesn't look like it was ever answered: http://www.gravityhelp.com/forums/topic/hide-credit-card-fields-when-total-is-zero

    I have a registration form that will sometimes have a total, other times total $0. It is a very complex form, so the conditional fields that are built in aren't sufficient.

    Basically, the form allows someone to register up to 5 children, for a registration fee. Each child's registration page has a place to enter a Groupon code, which covers the registration fee. But there are also extra add-ons that can come into play - so a Child may still incur a fee even if a Groupon is entered.

    I have tried multiple things, but I can't get the Authorize.net field to conditionally show/hide properly. There always seems to be a configuration that breaks it. The simplest solution would be to somehow use the total as an indicator. Is there a PHP script or anything that can detect this total and pass it to the form?

    Here is a link to my form, for reference. It's long, but if you choose only 1 child on page 1, know the other four are identical and you can get the idea.
    https://evosportscamps.com/registration/register-now

    Posted 6 years ago on Friday March 15, 2013 | Permalink
  2. As Dana stated in that topic, the total field cannot currently be used for conditional logic. You might be able to do it with jQuery, watching for that total to change, but I have not seen anyone post a solution for that.

    Posted 6 years ago on Sunday March 17, 2013 | Permalink
  3. I found a solution.

    I followed this tutorial to create merge tags for all form fields: http://gravitywiz.com/2012/08/04/better-pre-submission-confirmation/

    Then inserted the merge tag value of the total field into a hidden field. The credit card payment fields use conditional logic based off the value of the hidden field.

    Posted 6 years ago on Wednesday March 20, 2013 | Permalink
  4. Thanks for posting that work around.

    Posted 6 years ago on Saturday March 23, 2013 | Permalink