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.

Change Appearance of Read only Number Field

  1. Hi,

    Im looking to modify the appearance of the "number" field from the standard appearance, to looking the same as the "total" field.

    For the services we are selling on the website, the customer pays 50% of the total price upfront, which is calculated through the inputs they choose in the form. This is then displayed in the "total" field.

    For transparency, we have to add a "total price payable" field. To achieve this, we have used a calculation to sum the total inputs and multiply by 2.

    However we cannot get this field to appear as the predefined total included in the form.

    Hope you can help, and many thanks in advance,

    Rick

    Posted 10 years ago on Saturday April 27, 2013 | Permalink
  2. Rick,

    Check out this tutorial on how to format the number field to look like currency: http://gravitywiz.com/format-field-as-currency/

    You can then style the field appropriately to remove backgrounds and borders. If you have issues with that just post a link to your form and we can help you out there.

    Posted 10 years ago on Saturday April 27, 2013 | Permalink
  3. Thanks, just tried that but pasting the php code into my theme's functions.php but it caused the entire site to crash.

    Here is a link to the form, any help is greatly appreciated

    http://warwickstudentstorage.co.uk/book-storage/

    Posted 10 years ago on Saturday April 27, 2013 | Permalink
  4. Richard Vav
    Administrator

    When you copy'n'pasted the code into your functions file did you also copy the opening <?php tag from the top line of the code sample, if so try again but leave that out because your functions file will already have opening and closing php tags at the start and end of the file.

    Posted 10 years ago on Saturday April 27, 2013 | Permalink
  5. Thanks Rob and Richard, tried it both with and without the opening <?php tag with the same result each time. The theme is Udesign if that makes any difference at all?

    Posted 10 years ago on Saturday April 27, 2013 | Permalink
  6. Have been playing around with the snippet and have got as far as it not causing the entire site to crash, but now the form no longer displays. Could this be something to do with the recent update? I know there have been a few other issues knocking around.

    I've since moved on to changing the appearance of the number field, to look like a total field: basically no border, green text and a bit larger than the rest of the text.

    I'm completely stumped. This is the final hurdle to getting this site live and it is doing my head in!

    Any help is greatly appreciated.

    Posted 10 years ago on Sunday April 28, 2013 | Permalink
  7. So is that as far as a $199 developer licence gets you in terms of support? A link to a snippet which at worst crashes the site, and at best removes the form?

    Not too impressive guys.

    Posted 10 years ago on Wednesday May 1, 2013 | Permalink
  8. David Peralty

    Can you post your full functions.php file on pastebin so we can take a look at it?

    Posted 10 years ago on Wednesday May 1, 2013 | Permalink
  9. Thanks for the reply, here is a link to my themes function php http://pastebin.com/DwjUWQ06

    Posted 10 years ago on Sunday May 5, 2013 | Permalink
  10. If it is any help, I'm getting a jquery conflict error with this "jquery.js?ver=1.8.3:2" when the snippet is installed.

    Posted 10 years ago on Sunday May 5, 2013 | Permalink
  11. semyou
    Member

    I had a crash also as soon I installed it too. But it was due to the ' and " problems. Here is the fix I did on line 2. Let me know if it fixes yours.

    $script = '(function($){' .
    "$('.gf_money input').each(function(){" .
    '$(this).val(gformFormatMoney($(this).val()));' .
    '}).change(function(){' .
    '$(this).val(gformFormatMoney($(this).val()));' .
    '});' .
    '})(jQuery);';

    Posted 10 years ago on Sunday May 5, 2013 | Permalink
  12. semyou
    Member

    Sorry. Posted twice. Deleting this one.

    Posted 10 years ago on Sunday May 5, 2013 | Permalink
  13. Thanks for the post semyou, was having a nightmare with it and I'm afraid that I didn't get any further with your snippet.

    However, I have finally found that if there is any conditional logic in the form, the snippet will not work as expected. Bit annoying that the form isn't as dynamic as it was before, but glad to have it working and looking right.

    Would be great if you gravity forms guys could come up with a fix for the snippet when conditional logic is used. For forms that are sold as being good for pricing and purchases, a subtotal is a pretty crucial field.

    For anyone that is interested, the final form is here:

    http://warwickstudentstorage.co.uk/book-storage/

    Thanks again

    Posted 10 years ago on Monday May 6, 2013 | Permalink
  14. David Peralty

    Glad you got it sorted out. I'll mention it to Dave at GravityWiz. All my best!

    Posted 10 years ago on Monday May 6, 2013 | Permalink