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.

Enable calculations and allow user input in the same field

  1. Deaner666
    Member

    Hi there, not sure if what I'm trying to do is possible, but somebody might be able to offer a better solution if it's not...

    I'm using Gravity forms on a site that sells printed material of custom sizes. I have forms that allow people to enter the dimensions of the item they want (width and height). I've got it working fine with height and width number fields and calculation fields for working out the total area, but I want people to be able to specify their dimensions in cm OR inches (at the moment they can only specify cm).

    Here's a page from the site that is working with just cm:

    http://www.print-2-media.com/shop/banners/double-sided-pvc-banner-480gsm/

    and here's a page that I'm playing around with at the moment trying to get inches working as well:

    http://www.print-2-media.com/shop/banners/pvc-banner-510gsm-single-sided/

    I've got two sets of height and width boxes - one for cm and one for inches. I can "enable calculations" on one set, and have them do the conversion from cm to inches or vice versa. However, when I "enable calculations" on a field it can no longer accept input from the user.

    Is it possible to "enable calculations" and still have the field accept input? So the field will display a number if the user enters one, but will revert to showing a calculation from it's connected field if that connected field has a value entered into it?

    Alternatively, is there another way of dealing with the issue of converting one dimension to another?

    Cheers,

    Dave

    Posted 11 years ago on Thursday March 14, 2013 | Permalink
  2. No, that's not currently possible to accept input and perform a calculation on the same field. However, you might be able to use conditional logic to accept input in either cm or inches, then calculate the field based on which was entered. You could have two calculation fields, with a different formula in each, and have them displayed using conditional logic.

    Posted 11 years ago on Thursday March 14, 2013 | Permalink
  3. Deaner666
    Member

    Hi Chris, thanks for responding. I thought this might be the case. I was aware of the solution you suggest because I'm already using that method for all the other variations in the Gravity Forms on this site - I was hoping to avoid it for the dimensions conversion because it adds another degree of complexity (another degree to the matrix if you like).

    Maybe a feature that could be added in future Gravity Forms updates? Would be very useful :-)

    Posted 11 years ago on Thursday March 14, 2013 | Permalink
  4. I'll let the development team know of your request.

    Posted 11 years ago on Thursday March 14, 2013 | Permalink