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.

Paragraph Tag within Script?

  1. This is a sample of my source code. Not sure why there's a </p><p> tag within the script

    <p><script type='text/javascript'>
    jQuery(document).ready(function(){
    gf_apply_rules(7, [2]);
    jQuery('#gform_wrapper_7').show();</p>
    <p> //preventing 'Enter' key from submitting the form when submit button is hidden
    jQuery('#gform_7').submit(
    function(){
    return jQuery('#gform_submit_button_7').is(':visible');
    }
    );
    });
    Posted 13 years ago on Thursday December 2, 2010 | Permalink
  2. What version of Gravity Forms are you running?

    Something on your WordPress site is adding this, it's manipulating the shortcode output. This usually occurs in themes that have implemented the NOFORMAT or RAW shortcode. A lot of ThemeForest have implemented this functionality to allow you to wrap a shortcode around content you don't want to auto-format... the side effect is it changes how all other shortcodes are processed and ADDS auto-formatting to them... which is why the <p>'s are being added where line breaks exist.

    If you are running Gravity Forms v1.5 Beta try downloading the latest version from the Downloads page, I believe it may have a work around for this issue.

    If you are running an older version of Gravity Forms, let me know which version.

    Theme developers really need to NOT include this code in their themes. It has negative consequences by fixing one things but in the process breaks another.

    Posted 13 years ago on Thursday December 2, 2010 | Permalink
  3. Theme developers really need to NOT include this code in their themes. It has negative consequences by fixing one things but in the process breaks another.

    I totally agree! I am the developer of the Event Espresso plugin. I run into this problem CONSTANTLY.

    You are absolutely right about ThemeForest themes. They cause me constant grief. Most of these theme developers could care less, and state that they cannot support the thousands of plugins that are out there.

    Another thing. They are always including jquery.js in the theme header. Which always always overrides the jquery loaded by WordPress. These guys should not be developing themes if they cannot abide by a few simple guidelines implemented by WordPress.

    Any chance you can please share your work around for these issues? Man I could really use it. These theme developers are killing my productivity.

    Take care.

    Seth Shoultes
    Event Espresso

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  4. @Seth The problem Gravity Forms was having with the themes using the NOFORMAT or RAW shortcode functionality was any Javascript we were outputting was having <P> tags added after each line, because it was being autoformatted like text is in the rich text editor.

    We solved this by making sure anytime we output Javascript we do so on a single line. Downside is the JS isn't formatted nicely so it is easily human readable as it could be a long piece of JS and with it on one line it is hard to read without manually formatting it.

    Another solution that worked sometimes, although not always, was to have the user wrap our shortcode in the noformat/raw shortcode. So it would look like this:

    [noformat] [gravityforms id=1] [/noformat]

    But this didn't always work. It's frustrating that theme developers just use any code they find online without knowing the consequences. I know the exact article where this comes from (a CatsWhoCode.com tutorial) and I wish it was never written.

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink