<?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: Data Validation for Coupon Codes</title>
		<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes</link>
		<description>Gravity Support Forums Topic: Data Validation for Coupon Codes</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 04:33: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/data-validation-for-coupon-codes" rel="self" type="application/rss+xml" />

		<item>
			<title>mcdonna on "Data Validation for Coupon Codes"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes#post-20252</link>
			<pubDate>Wed, 09 Mar 2011 15:34:34 +0000</pubDate>
			<dc:creator>mcdonna</dc:creator>
			<guid isPermaLink="false">20252@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks, Carl, looking forward to it!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Data Validation for Coupon Codes"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes#post-20217</link>
			<pubDate>Wed, 09 Mar 2011 13:36:57 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20217@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;We will be launching new developer documentation that will document (with examples) all of the available hooks and filters by the end of next week when we launch our new web site and the Gravity Forms v1.5 public release.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mcdonna on "Data Validation for Coupon Codes"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes#post-20188</link>
			<pubDate>Tue, 08 Mar 2011 20:26:30 +0000</pubDate>
			<dc:creator>mcdonna</dc:creator>
			<guid isPermaLink="false">20188@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;thanks, this validation hook is just what I was looking for ... it's not listed in the documentation at &#60;a href=&#34;http://www.gravityhelp.com/documentation/hooks-and-filters/&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/hooks-and-filters/&#60;/a&#62; ... is there a more complete list somewhere? &#60;/p&#62;
&#60;p&#62;thanks again!&#60;br /&#62;
Donna
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Data Validation for Coupon Codes"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes#post-20158</link>
			<pubDate>Tue, 08 Mar 2011 16:45:50 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20158@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If they provide you with this information you could create your own database table and validate against that.  With the gform_validation hook you could do virtually anything because it's custom PHP that you can write.  So yes, you could do this.  &#60;/p&#62;
&#60;p&#62;If this is outside the scope of your skill set i'd be glad to refer you to a WordPress consultant with Gravity Forms customization experience who could assist you with this.  I already know one who has done coupon functionality so similar functionality has been done before.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>eric_johnson on "Data Validation for Coupon Codes"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes#post-20157</link>
			<pubDate>Tue, 08 Mar 2011 16:41:28 +0000</pubDate>
			<dc:creator>eric_johnson</dc:creator>
			<guid isPermaLink="false">20157@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for your feedback. After doing some more research, it appears that Groupon's API doesn't yet feature/include coupon validation. They will provide me with a list of coupon numbers, but if I get this data, can I add it to my database and have Gravity Forms validate against this table?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Data Validation for Coupon Codes"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes#post-20154</link>
			<pubDate>Tue, 08 Mar 2011 16:03:40 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20154@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Gravity Forms doesn't do this out of the box as it's more specialized functionality.&#60;/p&#62;
&#60;p&#62;HOWEVER thats why we have API hooks/filters so you can customize the functionality without changing the core plugin code and make it do what you want to do.&#60;/p&#62;
&#60;p&#62;The gform_validation hook is used to apply custom validation to a field.  You can use this hook to interact with the Groupon API and validate the coupon code.&#60;/p&#62;
&#60;p&#62;Here is an example of using the gform_validation hook:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_filter(&#38;#39;gform_validation&#38;#39;, &#38;#39;custom_validation&#38;#39;);
function custom_validation($validation_result){

// set the form validation to false
$validation_result[&#38;quot;is_valid&#38;quot;] = false;
$form = $validation_result[&#38;quot;form&#38;quot;];

// specify the first field to be invalid and provide custom validation message
$form[&#38;quot;fields&#38;quot;][0][&#38;quot;failed_validation&#38;quot;] = true;
$form[&#38;quot;fields&#38;quot;][0][&#38;quot;validation_message&#38;quot;] = &#38;quot;This field is invalid!&#38;quot;;

// update the form in the validation result with the form object you modified
$validation_result[&#38;quot;form&#38;quot;] = $form;

return $validation_result;

}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;So this isn't something Gravity Forms does out of the box but you can write code using the gform_validation hook to implement this functionality.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>eric_johnson on "Data Validation for Coupon Codes"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/data-validation-for-coupon-codes#post-20148</link>
			<pubDate>Tue, 08 Mar 2011 15:24:04 +0000</pubDate>
			<dc:creator>eric_johnson</dc:creator>
			<guid isPermaLink="false">20148@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I'm definitely going to purchase Gravity Forms for my e-commerce site provided I can do the following:&#60;/p&#62;
&#60;p&#62;I would like for the user to be able to enter a Groupon code in a Gravity Form field and have that field data validated against a database of coupon codes provided to me by Groupon. Can this be done?&#60;/p&#62;
&#60;p&#62;For example, the customer enters their name, address, and the Groupon code they received from their Groupon purchase and the form checks the database to see if the Groupon code is valid. If it is, the form is processed. If not, there is a notification method saying the coupon is invalid.&#60;/p&#62;
&#60;p&#62;Thank you.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
