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)
<?php
/*
Template Name: upload document
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<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 {
background-color:#ceecff;
border:2px solid #ADDEFC;
background-image:url(http://www.docsense.net/wp-content/themes/parallelus-traject/ajax-loader.gif);
background-repeat:no-repeat;
background-position:center 65px;
height:120px;
width:400px;
position:absolute;
top:50%;
left:50%;
margin-top:-60px;
margin-left:-200px;
z-index:100;
}
#fakeprogress h2 {
text-align:center;
margin:0;
padding:25px 0 0 0;
font-weight:bold;
font-size:24px;
font-family:sans-serif;
}
</style>
<style type="text/css">
body {font-size:13px;}
</style>
<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=1.3.13.1'></script>
<?php wp_head(); ?>
<?php
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");
}
?>
</head>
<body>
<?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(); ?>
</body>
</html>
Also here is another link that works for information on embedding forms http://www.gravityhelp.com/documentation/page/Embedding_A_Form
Posted 13 years ago on Thursday April 7, 2011 |
Permalink