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.

Field Value Formatting

  1. I was wondering if it is possible to have a Number Field or Single Line Text Field to auto format a value the user inputs. For example...I have a field that I want to collect the value of a person's house. The default value would be "$0", if the person inputs "250000", once the person tabs off of the field it gets formatted to "$250,000". Any help would be greatly appreciated.

    Basically, I'm looking for a currency field.

    Posted 13 years ago on Thursday July 7, 2011 | Permalink
  2. This isn't a built in feature on the Number and Single Line Text fields. It can be done, but you would have to use jQuery to mask the input of the text. It would have to be done as a customization. One jQuery script that I know works with Gravity Forms to mask text is this one:

    http://digitalbush.com/projects/masked-input-plugin/

    You have to implement it and then got the correct ID for the field you want to mask and then customize the jQuery call so it uses the correct field ID.

    We do plan on adding built in masks like this to the Single Input field in the next feature release of Gravity Forms.

    Posted 13 years ago on Thursday July 7, 2011 | Permalink
  3. Thanks I'll look into that!

    Posted 13 years ago on Thursday July 7, 2011 | Permalink
  4. Actually, How do I implement this solution? Meaning, where do I put this JQuery Code? Do I need to create a hook/filter to install it?

    Posted 13 years ago on Thursday July 7, 2011 | Permalink
  5. You would implement that jQuery in your theme on the page you are displaying your form, so you may want to make a custom page template and include it in that page template and then use that custom page template for the page you are displaying your form.

    You would implement it just like in the demo for that jQuery, and then you would change the ID of the field that you want to apply the mask to so that it uses the ID of the field in Gravity Forms. You can get the correct ID by viewing the page with the form on it and inspecting the HTML and see what the ID is for the INPUT that you want to apply the mask to.

    Posted 13 years ago on Thursday July 7, 2011 | Permalink
  6. Auto formatting number fieldswith commas, and specific digits to the right of the decimal are very much needed and looked forward to in your future release. Until then, I'll look into the jQuery also.

    Posted 13 years ago on Wednesday July 13, 2011 | Permalink
  7. A library of jQuery masks for auto formatting text entered into the Single Input text field is a feature that is planned for the next major release. We plan on having a custom option so that you can create your own auto-formatting mask by entering the format yourself.

    Posted 13 years ago on Wednesday July 13, 2011 | Permalink
  8. Any idea when is this going to happen? I think 1.6 came out after this statement and it doesn't include it if I'm not mistaken.

    Posted 13 years ago on Saturday November 19, 2011 | Permalink
  9. JavaScript input masks were included in 1.6. Have you tried it out?

    Posted 13 years ago on Sunday November 20, 2011 | Permalink
  10. Yes, I've seen them but if I'm not mistaken they still are not solving the issue of auto formatting currency. If you set up a mask like 999,999.99 you are stuck with the 8 digits. Am I missing something here?

    Posted 13 years ago on Sunday November 20, 2011 | Permalink
  11. The input masks were added in 1.6 as promised. However, you didn't really state what you're looking for. Please start a new topic with your specific request and we will be happy to help you if we can. Thank you.

    Posted 13 years ago on Monday November 21, 2011 | Permalink

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