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.

Before/After Content to a Form Entry Field

  1. domainguerilla
    Member

    Hello gents,

    I have a Donation field on my form and I cant figure out for the life of me how to add a "$" symbol in front of the this particular field and also a ".00" after this field. Although I have the form tied into the PayPal add-on and I know it will accept a "cents" value, I wanted to add these before/after the field to visually encourage the user to enter a whole dollar amount with no cents.

    Thank you so much and I appreciate your time!

    Posted 12 years ago on Thursday July 21, 2011 | Permalink
  2. Unfortunately the Donation field is going to automatically format any currency added to that field. So it's going to add the decimal points automatically. So the best solution may be to just enter this requirement in the field description.

    Posted 12 years ago on Thursday July 21, 2011 | Permalink
  3. domainguerilla
    Member

    Hey Carl! You are absolutely right, but is there a way to target that special donation field and use the " :before {} " or " :after {}" css styles to get a dollar sign symbol to the left of the box and a .00 to the right of the box?

    Posted 12 years ago on Thursday July 21, 2011 | Permalink
  4. If you still want to put these directly before and after the actual input, you'll need to use a little bit of jQuery scripting (the CSS before and after pseudo classes still aren't supported fully in all the browsers) to add the additional markup.. something like this added to your page template or theme's header.php file.

    http://pastie.org/2246399

    Of course, that assumes you have jQuery already initialized on your site and you would also need to view the source and get the actual ID of the input in your form then replace the "#input_96_1" in the example.

    After that, you'll probably want to target that input with a CSS rule to make the field a little shorter. Add something like this to your theme stylesheet.

    [css]
    body .gform_wrapper #input_96_1 {width:50px;}

    screenshot: http://bit.ly/r0LCn7

    Hope that helps out.

    Posted 12 years ago on Thursday July 21, 2011 | Permalink