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.

Adding Text to a Form

  1. dsurgoens
    Member

    Is it possible to add just text to a form -- not a form field, but just HTML text?

    Posted 14 years ago on Thursday February 4, 2010 | Permalink
  2. dsurgoens
    Member

    While the answer to this question still appears to be no, I did find a work around. The Description field for a form field allows HTML, which you can use CSS to style and move around as needed.

    Posted 14 years ago on Thursday February 4, 2010 | Permalink
  3. Currently the work around would be to use a section break, populate the description and leave the label blank. Then you can use CSS to manipulate the styling as needed.

    We are adding a free form HTML text element that can be added to a form and positioned like a field in the 1.4 release of Gravity Forms. This will enable you to place a block of text, an image, or any HTML wherever you want in your form.

    Posted 14 years ago on Thursday February 4, 2010 | Permalink
  4. net_mage
    Member

    Hey Carl - any eta on 1.4? I am launching a new site shortly and would love to know if I should wait for the new 1.4 goodies.

    Posted 14 years ago on Thursday February 4, 2010 | Permalink
  5. It's still going to be a little while for the 1.4 release, there's a lot going into that one.

    In the interim, as an alternate to putting HTML in the description fields, you could insert blocks of HTML content into the form with a little jQuery. For example. I created an "extracontent" div with some markup and placed it in the page template just above the closing body tag.

    screenshot

    Then I added a little jQuery snippet to the page header to reposition the div just above the label for the comments (field id #field_1_3)

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
      <script type="text/javascript">
      $(document).ready(function() {
      	$('#extracontent').insertBefore($('li#field_1_3 .gfield_label'));
    
      });
      </script>

    Note: if your theme already loads the jQuery library, you can leave the first script reference out of your implementation.

    That's pretty much it. You could create multiple content blocks and use the syntax above to place them wherever you want. You can change the "insertBefore" to "insertAfter" if you prefer to position something after a specific element.

    Form Screenshot - With Content Positioned

    Posted 14 years ago on Thursday February 4, 2010 | Permalink
  6. net_mage
    Member

    Oh this is perfect! I can use this script to implement the multi-paged forms as well. Very nice. Very nice.

    Posted 14 years ago on Thursday February 4, 2010 | Permalink
  7. Awesome. If you do implement a multi-page form, please share with the rest of the class. We would love to see it.

    Posted 14 years ago on Friday February 5, 2010 | Permalink

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