<?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: Is there a better way to write this double entry validation?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/is-there-a-better-way-to-write-this-double-entry-validation</link>
		<description>Gravity Support Forums Topic: Is there a better way to write this double entry validation?</description>
		<language>en-US</language>
		<pubDate>Mon, 13 Apr 2026 11:51:58 +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/is-there-a-better-way-to-write-this-double-entry-validation" rel="self" type="application/rss+xml" />

		<item>
			<title>studio625 on "Is there a better way to write this double entry validation?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/is-there-a-better-way-to-write-this-double-entry-validation#post-46130</link>
			<pubDate>Wed, 11 Jan 2012 11:52:51 +0000</pubDate>
			<dc:creator>studio625</dc:creator>
			<guid isPermaLink="false">46130@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay, thanks Chris!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Is there a better way to write this double entry validation?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/is-there-a-better-way-to-write-this-double-entry-validation#post-46073</link>
			<pubDate>Tue, 10 Jan 2012 22:02:50 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">46073@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;There's nothing wrong with doing it that way.  Instead of $_POST you can use rgpost, like this, if you want:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
	$submission1 = rgpost(&#38;#39;input_6&#38;#39;);
	$submission2 = rgpost(&#38;#39;input_31&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That will do some sanitization for you.  But your solution is perfectly acceptable.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>studio625 on "Is there a better way to write this double entry validation?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/is-there-a-better-way-to-write-this-double-entry-validation#post-45886</link>
			<pubDate>Mon, 09 Jan 2012 12:59:07 +0000</pubDate>
			<dc:creator>studio625</dc:creator>
			<guid isPermaLink="false">45886@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm building a registration form for a little league, and it's really important that the date of birth field is entered correctly, otherwise you have 13 year olds playing T-Ball. I want the users to enter the date of birth twice, then validate that both entries match.&#60;/p&#62;
&#60;p&#62;I managed to kludge together a custom validation that does this, but I don't like using the &#60;code&#62;$_POST&#60;/code&#62; global variables. Is there a better way to write this?&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;// Value of field 3_31 must match 3_6 and vice versa
add_filter(&#38;quot;gform_field_validation_3_31&#38;quot;, &#38;quot;custom_validation&#38;quot;, 10, 4);
add_filter(&#38;quot;gform_field_validation_3_6&#38;quot;, &#38;quot;custom_validation&#38;quot;, 10, 4);

function custom_validation($result, $value, $form, $field){

	$submission1 = $_POST[&#38;#39;input_6&#38;#39;];
	$submission2 = $_POST[&#38;#39;input_31&#38;#39;];

    if($result[&#38;quot;is_valid&#38;quot;] &#38;amp;&#38;amp; ($submission1 != $submission2)){
        $result[&#38;quot;is_valid&#38;quot;] = false;
        $result[&#38;quot;message&#38;quot;] = &#38;quot;The date of birth fields don&#38;#39;t match. Please make sure they are the same.&#38;quot;;
    }
    return $result;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
