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.

Posting code snippets through form

  1. So...
    I want my users to be able to post code snippets via gravity forms. The problem is that forms strip html from text fields.

    Is there any possibility to make this work? Like creating a special field that will accept any code but than convert it to text rather than just insert it as html into post?

    Posted 12 years ago on Thursday September 29, 2011 | Permalink
  2. Some fields should allow HTML such as the Post Body field when creating posts. By default fields such as the textarea field do not. There is a hook that can be used to configure allowable tags so that code can be inserted into a field. That hook is here:

    http://www.gravityhelp.com/documentation/page/Gform_allowable_tags

    Once you start allowing all sorts of code to be submitted via a form you could potentially open up your form to possible XSS attacks. So this has to be used with caution.

    Posted 12 years ago on Thursday September 29, 2011 | Permalink