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.

Formatting the "Other" choice field

  1. I've built a form for making donations, with radio buttons for various amounts, and 'Enable "other" choice' selected so that there is a text input where the donor can enter a different value. (Form is here: http://mnds.the-graphics.net/fundraising/donations/)

    The problem is that some donors type the £ sign in this field as well as the amount, which causes problems when the payment is processed. I would like to simply add the £ sign before the text input, but I can't see any way of doing this, as there's no place to add a label to that field.

    Any suggestions would be appreciated!

    Posted 11 years ago on Thursday May 31, 2012 | Permalink
  2. David Peralty

    As far as I know, there isn't any way to format the field. You can using the pre_submission filter check to see if the field has the £ and strip it if it does using PHP before the form is submitted and processed.

    http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter

    Posted 11 years ago on Thursday May 31, 2012 | Permalink
  3. Thanks for that suggestion David!

    In the end, I added a custom validation on that field so it throws an error message if the £ sign is there, or if anything else weird is input. (See http://www.gravityhelp.com/documentation/page/Using_the_Gravity_Forms_%22gform_validation%22_Hook )

    Posted 11 years ago on Friday June 1, 2012 | Permalink
  4. David Peralty

    That works as well. :) Great stuff. Glad you figured out a workable solution.

    Posted 11 years ago on Friday June 1, 2012 | Permalink

This topic has been resolved and has been closed to new replies.