<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Make form required, yet still display the default values</title>
		<link>https://legacy.forums.gravityhelp.com/topic/make-form-required-yet-still-display-the-default-values</link>
		<description>Gravity Support Forums Topic: Make form required, yet still display the default values</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 12:03:02 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/make-form-required-yet-still-display-the-default-values" rel="self" type="application/rss+xml" />

		<item>
			<title>Richard Vav on "Make form required, yet still display the default values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/make-form-required-yet-still-display-the-default-values#post-376116</link>
			<pubDate>Sat, 27 Jul 2013 04:41:05 +0000</pubDate>
			<dc:creator>Richard Vav</dc:creator>
			<guid isPermaLink="false">376116@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you still require assistance with this please open a new &#60;a href=&#34;http://www.gravityhelp.com/request-support/&#34; rel=&#34;nofollow&#34;&#62;support ticket&#60;/a&#62; or a &#60;a href=&#34;http://www.gravityhelp.com/priority-support/&#34; rel=&#34;nofollow&#34;&#62;priority support ticket&#60;/a&#62; if you are a developer license holder. Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sgarten on "Make form required, yet still display the default values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/make-form-required-yet-still-display-the-default-values#post-350458</link>
			<pubDate>Fri, 28 Jun 2013 17:24:05 +0000</pubDate>
			<dc:creator>sgarten</dc:creator>
			<guid isPermaLink="false">350458@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you please help me?  Here's what I tried, but it didn't work.&#60;/p&#62;
&#60;p&#62;First, you can view the form at &#60;a href=&#34;http://www.virtuecard.org&#34; rel=&#34;nofollow&#34;&#62;http://www.virtuecard.org&#60;/a&#62;.  All I want, are for the fields to be required, but since I'm using default values someone can click the &#34;request an invitation&#34; button and it will submit the default values &#34;name&#34; and &#34;email&#34;.  However, if they do click this I want it to give an error message.  Make sense?&#60;/p&#62;
&#60;p&#62;The form ID is 13 and the &#34;name&#34; field is field 4 and the &#34;email&#34; field is field 3.&#60;/p&#62;
&#60;p&#62;Here's the code I added to my functions.php file that didn't work.  I only attempted fixing field 4, but since that didn't work, I didn't code out for field 3 yet.&#60;/p&#62;
&#60;p&#62;Can you please tell me the correct code I should use?&#60;br /&#62;
-----&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;/p&#62;
&#60;p&#62;add_filter('gform_validation_13', 'custom_validation');&#60;br /&#62;
function custom_validation($validation_result){&#60;br /&#62;
    $form = $validation_result[&#34;form&#34;];&#60;/p&#62;
&#60;p&#62;    //supposing we don't want input 1 to be a value of 86&#60;br /&#62;
    if($_POST['input_4'] == name){&#60;/p&#62;
&#60;p&#62;        // set the form validation to false&#60;br /&#62;
        $validation_result[&#34;is_valid&#34;] = false;&#60;/p&#62;
&#60;p&#62;        //finding Field with ID of 1 and marking it as failed validation&#60;br /&#62;
        foreach($form[&#34;fields&#34;] as &#38;amp;$field){&#60;/p&#62;
&#60;p&#62;            //NOTE: replace 1 with the field you would like to validate&#60;br /&#62;
            if($field[&#34;id&#34;] == &#34;4&#34;){&#60;br /&#62;
                $field[&#34;failed_validation&#34;] = true;&#60;br /&#62;
                $field[&#34;validation_message&#34;] = &#34;This field is invalid!&#34;;&#60;br /&#62;
                break;&#60;br /&#62;
            }&#60;br /&#62;
        }&#60;/p&#62;
&#60;p&#62;    }&#60;/p&#62;
&#60;p&#62;    //Assign modified $form object back to the validation result&#60;br /&#62;
    $validation_result[&#34;form&#34;] = $form;&#60;br /&#62;
    return $validation_result;&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;?&#38;gt;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Make form required, yet still display the default values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/make-form-required-yet-still-display-the-default-values#post-346090</link>
			<pubDate>Wed, 26 Jun 2013 13:25:25 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">346090@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The code goes in your theme's functions.php file, and you would have to look at the examples and create the code needed to check those two fields. You would compare them against the default values you have in your form. So basically if the name field has the default value, then return an error, otherwise, do nothing because it is fine.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sgarten on "Make form required, yet still display the default values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/make-form-required-yet-still-display-the-default-values#post-346077</link>
			<pubDate>Wed, 26 Jun 2013 13:16:14 +0000</pubDate>
			<dc:creator>sgarten</dc:creator>
			<guid isPermaLink="false">346077@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks, David.&#60;/p&#62;
&#60;p&#62;I'm confused.  Can you please help me further?&#60;/p&#62;
&#60;p&#62;This form I'm using is form &#34;13&#34; and only has those two fields which are field 4 (name) and field 3 (email).&#60;/p&#62;
&#60;p&#62;Specifically, what code do I need to add to make this work and where do I put it?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Make form required, yet still display the default values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/make-form-required-yet-still-display-the-default-values#post-346022</link>
			<pubDate>Wed, 26 Jun 2013 12:35:06 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">346022@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You would have to add custom validation that then makes those default values not an acceptable value. To do this, you would use the following hook: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_validation&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_validation&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sgarten on "Make form required, yet still display the default values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/make-form-required-yet-still-display-the-default-values#post-346018</link>
			<pubDate>Wed, 26 Jun 2013 12:31:23 +0000</pubDate>
			<dc:creator>sgarten</dc:creator>
			<guid isPermaLink="false">346018@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;How can I make my form have required fields when using default values?&#60;/p&#62;
&#60;p&#62;For aesthetics, I have the labels hidden and I'm using values to display / direct the user for which information I want ( name &#38;amp; email ).  In my form I have both fields set to &#34;required&#34;. &#60;/p&#62;
&#60;p&#62;Currently, if you click the button &#34;request an invitation&#34; it will submit.  However, I want to make sure that people input their name and/or at least their e-mail address before the form will actually submit.  Is there a way to use default values, but make it so people have to enter in new text?&#60;/p&#62;
&#60;p&#62;You can see the form on my hope page: &#60;a href=&#34;http://virtuecard.org&#34; rel=&#34;nofollow&#34;&#62;http://virtuecard.org&#60;/a&#62; &#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
