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.

Javascript errors when using shortcode in template

  1. When inserting a form with conditional logic or text count via shortcode in the wysiwyg editor, say...

    [gravityform id="4" name="Quote - Remote Backup" description="false"]

    the form loads up no problem. However if I use say...

    <?php echo do_shortcode('[gravityform id="4" name="Quote - Remote Backup" description="false"]'); ?>

    in a template the form is automatically hidden, I believe due to Javascript issues.

    I get a few Javascript errors in firebug.

    "gf_apply_rules is not defined"
    "Uncaught TypeError: Object[object Object] has no method 'textareaCount'"

    I have tried disabling all plugins, switching to the 2011 theme, removing custom javascript files that I call in my header.

    It might also be worth mentioning that I use the advanced custom fields plugin found here and when inserting a shortcode in a wysiwyg textarea created by this plugin the forms will have the same issues, only through the standard wordpress wysiwyg editor will the forms display, with no Javascript error.


    Posted 12 years ago on Monday December 12, 2011 | Permalink
  2. When you place the form code in the template are you enqueueing your scripts and styles?

    Posted 12 years ago on Monday December 12, 2011 | Permalink
  3. I am experiencing the exact same problem, placing a shortcode in Advanced Custom Fields ( no regular content area ).

    I have tried manually enqueing my scripts too. but to no avail. My form is on this page here...

    All other forms work on this site, ( such as )

    Getting rid of Advanced Custom Fields isn't an option unfortunately so are there any other fixes available for me?

    Posted 12 years ago on Tuesday December 13, 2011 | Permalink
  4. Komodo, what does not work for you? Can you described exactly what is not working?

    Posted 12 years ago on Thursday December 15, 2011 | Permalink