<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gravity Forms Support &#187; How To</title>
	<atom:link href="http://www.gravityhelp.com/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gravityhelp.com</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 20:33:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>CSS Ready Classes for Gravity Forms</title>
		<link>http://www.gravityhelp.com/css-ready-classes-for-gravity-forms/</link>
		<comments>http://www.gravityhelp.com/css-ready-classes-for-gravity-forms/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 16:48:19 +0000</pubDate>
		<dc:creator>Kevin Flahaut</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gravityhelp.com/?p=1129</guid>
		<description><![CDATA[In Gravity Forms 1.5 we're adding some new "Ready Classes". Using these new classes, you can easily create more advanced alternative layouts for the fields in your forms. Essentially, Ready Classes are class names that you can add to the parent element surrounding each field to take advantage of pre-defined styles included in the default... <a href="http://www.gravityhelp.com/css-ready-classes-for-gravity-forms/"> read more</a]]></description>
				<content:encoded><![CDATA[<p>In Gravity Forms 1.5 we're adding some new "Ready Classes". Using these new classes, you can easily create more advanced alternative layouts for the fields in your forms.</p>
<p>Essentially, Ready Classes are class names that you can add to the parent element surrounding each field to take advantage of pre-defined styles included in the default form stylesheet.<br />
<span id="more-1129"></span></p>
<h2>How to Use Ready Classes</h2>
<p>To add a Ready Class to a field, just edit your form in the Form Builder and then select the field you want to add the classes to. Under the "Advanced" tab, you’ll see an input called "CSS class name". Add the Ready Class name or names you want to add to the field here and then save the form.</p>
<p><a href="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_admin_input.png"><img src="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_admin_input.png" alt="" title="readyclass_admin_input" width="590" height="767" class="alignnone size-full wp-image-1145 drop_shadow" /></a></p>
<p>Please note that this feature does NOT update live in the Form Builder. After you specify your Ready Class names, just save the form and you’ll see the classes being applied to your form in the preview window and on the live site.</p>
<h2>The Ready Class Names</h2>
<p>Here are the Ready Classes that are built in the Gravity Forms default stylesheet that you can use right away without having to write any of your own CSS.</p>
<h3>Halves (2 Columns)</h3>
<p>Note: These only work with the "top label" form layout option.</p>
<h4 class="readyclassname">gf_left_half</h4>
<p>This places the field in the left column (left half) of a 2 column layout. This only work with the "top label" form layout option.</p>
<h4 class="readyclassname">gf_right_half</h4>
<p>This places the field in the left column (right half) of a 2 column layout. This only work with the "top label" form layout option.</p>
<p>To align two fields side by side (2 equal columns) you can add these classes. The two fields have to be adjacent to each other in the Form Builder. The gf_left_half class has to be added to the first field and the gf_right_half class to the second field.</p>
<p>Example:</p>
<p><img src="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_2column.png" alt="" title="readyclass_2column" width="590" height="427" class="alignnone size-full wp-image-1155 drop_shadow" /></p>
<h3>Thirds (3 Columns)</h3>
<h4 class="readyclassname">gf_left_third</h4>
<p>This places the field in the left column (left third) of a 3 column layout. This only work with the "top label" form layout option.</p>
<h4 class="readyclassname">gf_middle_third</h4>
<p>This places the field in the middle column (middle third) of a 3 column layout. This only work with the "top label" form layout option.</p>
<h4 class="readyclassname">gf_right_third</h4>
<p>This places the field in the right column (right third) of a 3 column layout. This only work with the "top label" form layout option.</p>
<p>To align three fields side by side (3 equal columns) you can add these classes. The three fields have to be adjacent to each other in the Form Builder. The gf_left_third class has to be added to the first field, the gf_middle_third class to the second field and the gf_right_third class to the third field.</p>
<p>Example:</p>
<p><img src="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_3column.png" alt="" title="readyclass_3column" width="590" height="497" class="alignnone size-full wp-image-1153 drop_shadow" /></p>
<h3>List Classes</h3>
<h4 class="readyclassname">gf_list_2col</h4>
<p>This turns a multiple choice/checkbox list into an equally-spaced 2 column format. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_3col</h4>
<p>This turns a multiple choice/checkbox list into an equally-spaced 3 column format. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<p>Example:</p>
<p><img src="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_list_3column.png" alt="" title="readyclass_list_3column" width="590" height="522" class="alignnone size-full wp-image-1156 drop_shadow" /></p>
<h4 class="readyclassname">gf_list_4col</h4>
<p>This turns a multiple choice/checkbox list into an equally-spaced 4 column format. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_5col</h4>
<p>This turns a multiple choice/checkbox list into an equally-spaced 5 column format. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_inline</h4>
<p>This turns a multiple choice/checkbox list into an inline horizontal list (not evenly spaced columns). This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<p>Example:</p>
<p><img src="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_list_inline.png" alt="" title="readyclass_list_inline" width="590" height="596" class="alignnone size-full wp-image-1157 drop_shadow" /></p>
<h4 class="readyclassname">gf_list_height_25</h4>
<p>This applies a 25px height value all multiple choice/checkbox items in that list. This can be useful to avoid "hanging floats" caused by list items of unequal height. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_height_50</h4>
<p>This applies a 50px height value all multiple choice/checkbox items in that list. This can be useful to avoid "hanging floats" caused by list items of unequal height. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_height_75</h4>
<p>This applies a 75px height value all multiple choice/checkbox items in that list. This can be useful to avoid "hanging floats" caused by list items of unequal height. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_height_100</h4>
<p>This applies a 100px height value all multiple choice/checkbox items in that list. This can be useful to avoid "hanging floats" caused by list items of unequal height. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_height_125</h4>
<p>This applies a 125px height value all multiple choice/checkbox items in that list. This can be useful to avoid "hanging floats" caused by list items of unequal height. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h4 class="readyclassname">gf_list_height_150</h4>
<p>This applies a 150px height value all multiple choice/checkbox items in that list. This can be useful to avoid "hanging floats" caused by list items of unequal height. This only applies to multiple choice/checkbox lists and work with any of the form label position settings.</p>
<h3>Other Classes</h3>
<h4 class="readyclassname">gf_scroll_text</h4>
<p>This converts a section break field into a box with a fixed height that will automatically show a scroll bar if there’s a large amount of text. This is useful if you’re wanting to show large amounts of content to the user, but don’t want to have to link to it or make the form very long to show it (Terms of Service Agreements, etc). This class only works on section breaks and works with any of the form label position settings.</p>
<p>Example:<br />
<img src="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_scroll_text.png" alt="" title="readyclass_scroll_text" width="590" height="702" class="alignnone size-full wp-image-1158 drop_shadow" /></p>
<h4 class="readyclassname">gf_hide_ampm</h4>
<p>This hides the am/pm selector in the time field- this only hides the field on the form, not in the form entry table. This works with any of the form label position settings.</p>
<h4 class="readyclassname">gf_hide_charleft</h4>
<p>This hides the characters left counter beneath paragraph text fields when using the maximum characters option. This works with any of the form label position settings.</p>
<h2>Q &#038; A</h2>
<h3>Can I use multiple classes on the same field?</h3>
<p>Yes, you can use multiple classes together. Just separate each class name by a space. Note: This doesn't work for all of the styles, but many can be combined if they're applicable to the field type. For example, you may have a 2 column primary layout, and want to use 2 column list layouts within the columns.</p>
<h3>Can I create my own classes?</h3>
<p>Yes, the classes are added to the parent &lt;li&gt; element surrounding a field so you can define your own class name and add your own rules to your theme stylesheet based on that class name being added to the field.</p>
<h2>Notes</h2>
<p>You can also see an <a href="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_fullsample.png"target="_blank">example</a>  of several of these classes applied in one form <a href="http://www.gravityhelp.com/wp-content/uploads/2010/11/readyclass_fullsample.png" target="_blank">here</a>. </p>
<p>One final note. As with any CSS rules, your particular theme CSS may override or supersede some of these styles. They've been tested in a variety of themes and work well, but you may have to make some adjustments to your theme styles for everything to work properly. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.gravityhelp.com/css-ready-classes-for-gravity-forms/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Gravity Forms CSS Visual Guide</title>
		<link>http://www.gravityhelp.com/gravity-forms-css-visual-guide/</link>
		<comments>http://www.gravityhelp.com/gravity-forms-css-visual-guide/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 22:51:12 +0000</pubDate>
		<dc:creator>Kevin Flahaut</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.gravityhelp.com/?p=865</guid>
		<description><![CDATA[View Guide (HTML Version) &#124; Download Guide (png) We've put together a simple visual guide to help illustrate the structure of a form and the CSS class relationship. Basic Structure Gravity Forms are structured so that every element can be targeted and manipulated via CSS. Most elements share reusable class names to affect styling, and... <a href="http://www.gravityhelp.com/gravity-forms-css-visual-guide/"> read more</a]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.gravityhelp.com/wp-content/uploads/2010/02/guide_header1.jpg" alt="" title="guide_header" width="580" height="290" class="alignnone size-full wp-image-867" /></p>
<p><strong><a href="http://rkt.gs/cssguide" target="_blank">View Guide (HTML Version)</a></strong> | <strong><a href="http://rkt.gs/cssguidepng" target="_blank">Download Guide (png)</a></strong></p>
<p>We've put together a simple visual guide to help illustrate the structure of a form and the CSS class relationship.<br />
<span id="more-865"></span></p>
<h3>Basic Structure</h3>
<p>Gravity Forms are structured so that every element can be targeted and manipulated via CSS. Most elements share reusable class names to affect styling, and many elements have unique ID's that you can use to target specific elements within the form. By using <a href="http://www.w3.org/TR/CSS21/cascade.html" target="_blank">CSS inheritance</a>, you can effectively style every element in your form.</p>
<p>All element ID's are based on the unique form ID and then a field ID. For example: <strong>#gform_wrapper_xx</strong> where "xx" is the form ID or <strong>#field_xx_yyy</strong> where "xx" is the form ID and "yyy" is the field ID. </p>
<h3>Configurable Classes</h3>
<p>There are 3 label classes that are applied based on the individual form settings, .top_label, .left_label and .right_label. Other elements change positions, widths, etc. based on inheritance from these label classes. Only the "top_label" class is represented in this example. Additionally, for many of the individual fields, there are classes of .small, .medium and .large which are also defined in the form admin.</p>
<p>Finally, for most of the fields, the user can define additional class names in order to apply additional custom styles or to target elements for other types of manipulation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gravityhelp.com/gravity-forms-css-visual-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a Modal Form with Gravity Forms and FancyBox</title>
		<link>http://www.gravityhelp.com/creating-a-modal-form-with-gravity-forms-and-fancybox/</link>
		<comments>http://www.gravityhelp.com/creating-a-modal-form-with-gravity-forms-and-fancybox/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 00:24:57 +0000</pubDate>
		<dc:creator>Kevin Flahaut</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.gravityhelp.com/?p=628</guid>
		<description><![CDATA[There have been a few questions on how to create a Gravity Form in a modal window. For this example, we're going to use the jQuery script "FancyBox" to create the modal form. Basically, what you're going to do is to create a form, embed it in a simple page and then link to it... <a href="http://www.gravityhelp.com/creating-a-modal-form-with-gravity-forms-and-fancybox/"> read more</a]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.gravityhelp.com/wp-content/uploads/2009/12/screenshot_969.png" alt="Modal Gravity Form" title="Modal Gravity Form" width="590" height="345" class="alignnone size-full wp-image-649" /></p>
<p>There have been a few questions on how to create a Gravity Form in a modal window.  For this example, we're going to use the jQuery script "<a href="http://fancybox.net/home">FancyBox</a>" to create the modal form.</p>
<p>Basically, what you're going to do is to create a form, embed it in a simple page and then link to it from the page you want to include the modal form. Pretty simple right?<br />
<span id="more-628"></span></p>
<div class="update_notice">
<h3>Update: September 9, 2010</h3>
<p>The 1.4 version of GF released yesterday includes an option to submit the form via ajax. This means that the page doesn't have to refresh, and you can use other popup options that don't have to rely on using this iframe &#038; plainpage template approach. Here's a link to some additional information on enabling the ajax submission.</p>
<p><a href="http://www.seodenver.com/gravity-forms-ajax/">http://www.seodenver.com/gravity-forms-ajax/</a></p>
<p>Most of the modal window scripts allow you to wrap a div around inline content such as a form shortcode and then launch it in the modal window. The problem before was when the form submitted and refreshed the page, if the validation failed, the modal window was closed on the page refresh and you couldn't see the errors. With the ajax submission enabled, this isn't an issue now and you have a lot more options as far as modal window scripts.</p>
<p>Fancybox was one that supported modal iframes so it was my choice for the original tutorial but you should be able to use most of these as well.</p>
<p><a href="http://speckyboy.com/2009/03/31/10-image-and-gallery-lightbox-solutions-for-wordpress-plugins/">http://speckyboy.com/2009/03/31/10-image-and-gallery-lightbox-solutions-for-wordpress-plugins/</a>
</div>
<h3>Installing The Script</h3>
<p>To start, you'll need to download the script from the <a href="http://fancybox.net/home" target="_blank">FancyBox website</a> and unzip the file to your desktop. You'll want to look in the main folder and find the "fancybox" sub-folder. That's what you'll need to upload to your theme directory. <strong>Upload the entire "fancybox" folder and its contents to the root of your WordPress theme folder</strong>.</p>
<p>Once you've uploaded the content, you'll need to reference the files and initialize the script. For that, you'll need to open the header.php file in your theme folder and copy/paste the following code into the &lt;head&gt; section of the page.</p>
<pre class="brush:html;">
&lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js">&lt;/script>
&lt;link rel="stylesheet" type="text/css" href="&lt;?php bloginfo('template_directory'); ?>/fancybox/jquery.fancybox-1.3.0.css" media="screen" />
&lt;script type="text/javascript" src="&lt;?php bloginfo('template_directory'); ?>/fancybox/jquery.fancybox-1.3.0.pack.js">&lt;/script>
&lt;script type="text/javascript">
  $(document).ready(function() {

	$("a.iframeFancybox1").fancybox({
		'width'		      :	600,
		'height'		      :	650,
		'overlayOpacity'	 :	'0.4',
		'overlayColor'		 :	'#000',
		'hideOnContentClick' :   false,
		'autoScale'     	 :   false,
   		'transitionIn'		 :   'elastic',
		'transitionOut'	 :   'elastic',
		'type'			 :   'iframe'
	});
  });
&lt;/script>
</pre>
<p>Once you have uploaded the fancybox folder to your theme and added the references to the header.php file, the installation process is complete. Now, you may want to configure some elements of the script. If you'll notice in the code above, there are some configuration variables added for the iframe sizes, etc.</p>
<pre class="brush:html;">
        $("a.iframeFancybox1").fancybox({
		'width'		      :	600,
		'height'		      :	650,
		'overlayOpacity'	 :	'0.4',
		'overlayColor'		 :	'#000',
		'hideOnContentClick' :   false,
		'autoScale'     	 :   false,
   		'transitionIn'		 :   'elastic',
		'transitionOut'	 :   'elastic',
		'type'			 :   'iframe'
	});
</pre>
<p>You can configure this to fit your particular form. For this example, any page link with the class "iframeFancybox1" will launch a modal FancyBox window that's 600x650 pixels in size. If you need multiple sizes for different forms, it's easy enough to copy this, change the class name and the size values as you need.</p>
<p><em>Note: Yes, there are a few FancyBox plugins in the repository that you can try if you'd like to skip the installation steps above. Some offer more customization features than others and you'll have to refer to their documentation for specific information related to using iframed content. For this example, I chose to install the script manually since it's a pretty straightforward process.</em></p>
<h3>Creating A New Page Template</h3>
<p>Now, that the FancyBox script is successfully installed, you will need to create a basic page template to use for your iframed page. You need a page that only has the form content, and no other structural elements. You can copy my example below, save it as plainpage.php and upload it to the root of your theme folder.</p>
<pre class="brush:html;">
&lt;?php
 /*
 Template Name: plain page
 */
?>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
&lt;head>
  &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  &lt;meta name="MSSmartTagsPreventParsing" content="true" />
  &lt;meta http-equiv="Imagetoolbar" content="No" />
  &lt;title>My Form Title&lt;/title>
  &lt;style type="text/css">
  	body {font-size:13px;}
  &lt;/style>
  &lt;link rel='stylesheet' id='gforms_css-css'  href='&lt;?php bloginfo('url'); ?>/wp-content/plugins/gravityforms/css/forms.css?ver=3.0.1' type='text/css' media='all' />
  &lt;script type='text/javascript' src='&lt;?php bloginfo('stylesheet_directory'); ?>/includes/js/jquery-142.js?ver=1.4.1'>&lt;/script>
  &lt;script type='text/javascript' src='&lt;?php bloginfo('url'); ?>/wp-content/plugins/gravityforms/js/conditional_logic.js?ver=1.3.13.1'>&lt;/script>
  &lt;/head>
&lt;body>
  &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  &lt;?php the_content('read more'); ?>
  &lt;?php endwhile; endif; ?>
  &lt;?php wp_footer(); ?>
&lt;/body>
&lt;/html>
</pre>
<p><a href="http://pastie.org/1090660.txt">raw markup</a></p>
<p>You need to make sure the page template includes the  &lt;?php wp_footer(); ?> references so the Gravity Forms conditional logic scripts load correctly. If you're using any additional form-specific styles, you'll want to include those inline as well.</p>
<h3>Putting It All Together</h3>
<p>Now that you've created the "plain page" template and uploaded it to your theme directory, you can go to the WordPress admin and create a new page. You'll want to include any content and your form in the content editor and then apply the new page template you've just created. </p>
<p><img src="http://www.gravityhelp.com/wp-content/uploads/2009/12/fancybox_3.png" alt="New Page Template" title="New Page Template" width="590" height="345" class="alignnone size-full wp-image-657" /></p>
<p>You will probably want to exclude the simple form page from any navigation elements, and you can easily do this with a plugin like <a href="http://wordpress.org/extend/plugins/exclude-pages/">Exclude Pages</a>.</p>
<p>Now you're down to the final steps. You'll simply go the page you want to launch the modal form from and include a link with the class you defined earlier to invoke the script.</p>
<pre class="brush:html;">
&lt;a href="http://www.yourdomain.com/modal-popup-form-page/" class="iframeFancybox1">&lt;h3>launch framed form in modal window&lt;/h3>&lt;/a>
</pre>
<h3>The Result</h3>
<p>If you've installed and configured everything correctly, you should end up with something like my example in the video below.. <em>(yes, @MikeSigers if you're reading along, it has audio too)</em></p>
<p><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'><param name='movie' value='http://screenr.com/Content/assets/screenr_1116090935.swf' /><param name='flashvars' value='i=34740' /><param name='allowFullScreen' value='true' /><embed src='http://screenr.com/Content/assets/screenr_1116090935.swf' flashvars='i=34740' allowFullScreen='true' width='560' height='345' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object></p>
<p><a href="http://screenr.com/K8S" target="_blank">video link: http://screenr.com/K8S</a></p>
<h3>Final Notes</h3>
<p>I hope that gets you pointed in the right direction. At the time of writing, the fancybox script was at version 1.3.0, be sure to check your version and update file paths and file names accordingly. Also, as I mentioned in the video, there are other modal window scripts that may work for this. The concept would be the same overall. The important thing to look for is a script that actually supports iframed content, not one that loads remote content via ajax methods.</p>
<p>Also, please note: If you're having issues setting up and configuring the Fancybox script, please refer to the <a href="http://groups.google.com/group/fancybox">Fancybox  support forums</a> as the Gravity Forms forums are only for issues directly related to the forms themselves. Thanks.</p>
<p>Happy form building.</p>
<p>UPDATE: As of version 1.4, you can now submit a form via AJAX so you may be able to use other scripts that don't work with the iframe method. Several will allow you to include hidden, inline content in a div rather than creating a separate page to host the content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gravityhelp.com/creating-a-modal-form-with-gravity-forms-and-fancybox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Clearing Default Field Values with jQuery</title>
		<link>http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/</link>
		<comments>http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 20:26:53 +0000</pubDate>
		<dc:creator>Kevin Flahaut</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Default Values]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.gravityhelp.com/?p=516</guid>
		<description><![CDATA[A few people have asked about automatically clearing the default field values on focus. While that's not a feature in the current version of Gravity Forms, It's easy enough to accomplish with a little bit of jQuery goodness. This script will remove any default value from input fields and textareas on focus, and if you... <a href="http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/"> read more</a]]></description>
				<content:encoded><![CDATA[<p>A few people have asked about automatically clearing the default field values on focus. While that's not a feature in the current version of Gravity Forms, It's easy enough to accomplish with a little bit of jQuery goodness. This script will remove any default value from input fields and textareas on focus, and if you haven't changed it, will restore it on blur.<br />
<span id="more-516"></span><br />
You can add the script below to your header.php file if you want it to be available for all of your forms, or can <a href="http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates" target="_blank">create a new page template</a>, associate it with the page the form is on and include the script there. Note: This snippet requires that the <a href="http://jquery.com/" target="_blank">jQuery library</a> is <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">already loaded</a> in your theme to function properly.</p>
<h3>The Script</h3>
<pre class="brush: js;">
&lt;script type="text/javascript">

jQuery(document).ready(function() {

	jQuery.fn.cleardefault = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};
jQuery(".clearit input, .clearit textarea").cleardefault();

});

&lt;/script>
</pre>
<h3>Defining the Fields</h3>
<p>Once you've included the script in your page, it's easy to define which fields you want to clear. Simply open up the form in the Gravity Forms admin, navigate to the field you want to clear, click on the Advanced tab and add the CSS Class Name "<strong>clearit</strong>". Save the form and you're good to go.</p>
<p><img src="http://www.gravityhelp.com/wp-content/uploads/2009/11/clearfield_screen.jpg" alt="Clearing Default Fields" title="Clear Defaults" width="513" height="712" class="alignnone size-full wp-image-529" /></p>
<p>That's all there is to it. Of course, you could tweak the script and change the class name to suit your preference. Check out the quick screencast below to see it in action.</p>
<p><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'><param name='movie' value='http://screenr.com/Content/assets/screenr_0817090731.swf' /><param name='flashvars' value='i=24233' /><param name='allowFullScreen' value='true' /><embed src='http://screenr.com/Content/assets/screenr_0817090731.swf' flashvars='i=24233' allowFullScreen='true' width='560' height='345' pluginspage='http://www.macromedia.com/go/getflashplayer' style='margin-top:10px;'></embed></object></p>
<h3>Something to Consider</h3>
<p>Please be aware that if you're using default values on fields you've defined as required, they will validate even if the user doesn't not populate them or change their value.  This is due to the fact that the default value will be submitted as the form field value if they are not changed by the user.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
