<?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: Field for offer code</title>
		<link>https://legacy.forums.gravityhelp.com/topic/field-for-offer-code</link>
		<description>Gravity Support Forums Topic: Field for offer code</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 18:43:06 +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/field-for-offer-code" rel="self" type="application/rss+xml" />

		<item>
			<title>Carl Hancock on "Field for offer code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/field-for-offer-code#post-17944</link>
			<pubDate>Tue, 08 Feb 2011 13:33:01 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">17944@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;There is no built in &#34;offer code&#34; functionality.  It's possible to implement, but you would have to use a standard text input field and then use the gform_validation hook to write your own custom validation to validate this field.  I'm not sure what your PHP and WordPress development skill level is... but here is an example of 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;The gform_validation hook allows you to specific custom validation for a field.  So you could use it to validate a string against a database table containing values, or virtually anything you want to do from a validation standpoint as long as you know how to write the code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>veryc on "Field for offer code"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/field-for-offer-code#post-17910</link>
			<pubDate>Tue, 08 Feb 2011 09:58:56 +0000</pubDate>
			<dc:creator>veryc</dc:creator>
			<guid isPermaLink="false">17910@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, is there a field I can use for an offer code. The code will be an alphanumeric string. Ideally I want to verify the code is valid before submitting form.&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
