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.

Ready Class not working

  1. ralpheweotto
    Member

    I'm using <?php gravity_forms(); ?> to print the form, but when using that, the browser ignores ready classes.

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  2. If you're using the php function call to embed the form then you'll need to manually enqueue the CSS and scripts for everything to work properly.

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

    The Ready Class styles are in the default forms stylesheet, but if it's not being loaded properly, then the style rules associated with the class names aren't going to be applied.

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  3. Is there any reason why you aren't using the shortcode rather than using the function call?

    The ready classes aren't working because while the shortcode can automatically enqueue the necessary scripts and CSS a form needs to function, the function call cannot do this automatically because of how WordPress executes.

    So this means you have to use another function call placed in your themes functions.php file to enqueue the necessary scripts and CSS for a specific form. Documentation for this enqueue function call can be found here:

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

    It's also discussed on the documentation page that talks about how to display a form via the function call at the bottom of this page:

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

    The function call is more advanced and has to be implemented correctly because of how enqueue in WordPress works. Shortcodes are able to enqueue from the WordPress loop because of how WordPress executes code. Function calls, however, can't do this automatically because they may not be executing somewhere in the code execution life cycle that allows them to do so.

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  4. Can you use your enqueue function in functions.php?

    Posted 12 years ago on Friday September 2, 2011 | Permalink