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.

Gravity_form_enqueue_scripts documentation page incomplete, cut off

  1. this page is incomplete:

    the first sentence is cut off. Also it does not indicate WHERE you should be putting the enqueue script. in the functions.php file of your theme i assume. also it does not mention if you need to run that on an action such as init and then wrap it in a function. or maybe not.

    Posted 11 years ago on Thursday April 7, 2011 | Permalink
  2. danielpettifer

    I have successfully used the enqueue scripts in the page templates of my forms. I was having trouble getting the animation and conditional logic to work. Here is a copy of my page template (not sure if it helps)

     Template Name: upload document
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="" xml:lang="en" lang="en">
      <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
      <meta name="MSSmartTagsPreventParsing" content="true" />
      <meta http-equiv="Imagetoolbar" content="No" />
      <title>My Form Title</title>
      <style type="text/css">
    #fakeprogress {
    	border:2px solid #ADDEFC;
    	background-position:center 65px;
    #fakeprogress h2 {
    	padding:25px 0 0 0;
      <style type="text/css">
      	body {font-size:13px;}
      <link rel='stylesheet' id='gforms_css-css'  href='<?php bloginfo('url'); ?>/wp-content/themes/parallelus-traject/css/gravforms.css' type='text/css' media='all' />
      <script type='text/javascript' src='<?php bloginfo('stylesheet_directory'); ?>/includes/js/jquery-142.js?ver=1.4.1'></script>
      <script type='text/javascript' src='<?php bloginfo('url'); ?>/wp-content/plugins/gravityforms/js/conditional_logic.js?ver='></script>
     <?php wp_head(); ?>
    if(!is_admin()) {
        wp_enqueue_script("gforms_ui_datepicker", WP_PLUGIN_URL . "/gravityforms/js/jquery-ui/ui.datepicker.js", array("jquery"), "1.4", true);
        wp_enqueue_script("gforms_datepicker", WP_PLUGIN_URL . "/gravityforms/js/datepicker.js", array("gforms_ui_datepicker"), "1.4", true);
        wp_enqueue_script("gforms_conditional_logic_lib", WP_PLUGIN_URL . "/gravityforms/js/conditional_logic.js", array("gforms_ui_datepicker"), "1.4", true);
        wp_enqueue_style("gforms_css", WP_PLUGIN_URL . "/gravityforms/css/forms.css");
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
      <?php the_content('read more'); ?>
      <?php endwhile; endif; ?>
      <?php gravity_form_enqueue_scripts(7,true); ?>
      <?php gravity_form(7, false, false, false, '', true); ?>
      <?php wp_footer(); ?>

    Also here is another link that works for information on embedding forms

    Posted 11 years ago on Thursday April 7, 2011 | Permalink
  3. thanks for the reply! I was more pointing out missing documentation than asking for help.

    I used this instead:

    function my_init() {
    	if (!is_admin()) {
    		gravity_form_enqueue_scripts(1, false);
    add_action('init', 'my_init');

    and put it in the themes' function.php file and it seems to take care of everything.

    Posted 11 years ago on Thursday April 7, 2011 | Permalink
  4. danielpettifer

    You are welcome : ) Some of the documentation is a bit screwed as they just updated everything but as long as people point it out they will fix it!

    Posted 11 years ago on Thursday April 7, 2011 | Permalink