<?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: Force postal code format</title>
		<link>https://legacy.forums.gravityhelp.com/topic/force-postal-code-format</link>
		<description>Gravity Support Forums Topic: Force postal code format</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 11:56:37 +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/force-postal-code-format" rel="self" type="application/rss+xml" />

		<item>
			<title>Carl Hancock on "Force postal code format"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/force-postal-code-format#post-20719</link>
			<pubDate>Wed, 16 Mar 2011 18:26:35 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20719@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The hook is not in the current documentation.  &#60;/p&#62;
&#60;p&#62;The hook is the gform_validation hook.  Here is an example of it's usage:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
add_filter(&#38;#39;gform_validation_YOURFORMID&#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;You would have to know PHP and hook/filter usage in order to put it to use.  That example just sets a field to invalid, you would have to add code above that to check the field value and decide if you wanted to set it to invalid or not.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dfrayne on "Force postal code format"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/force-postal-code-format#post-20718</link>
			<pubDate>Wed, 16 Mar 2011 18:00:01 +0000</pubDate>
			<dc:creator>dfrayne</dc:creator>
			<guid isPermaLink="false">20718@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Carl. Is that hook in the current documentation? Our contests launches this Saturday. Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Force postal code format"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/force-postal-code-format#post-20716</link>
			<pubDate>Wed, 16 Mar 2011 17:56:42 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20716@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes, it is possible via the gform_validation hook and custom code.  You would have to be sure your field description explains the correct format.  We will be launching all new documentation (and site) next week, and the gform_validation hook will have a better example available for users that want to use it to implement custom validation.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dfrayne on "Force postal code format"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/force-postal-code-format#post-20715</link>
			<pubDate>Wed, 16 Mar 2011 17:52:10 +0000</pubDate>
			<dc:creator>dfrayne</dc:creator>
			<guid isPermaLink="false">20715@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is it possible to force the postal code format, as in the phone format? ie. A1A 1A1. I would like to have it all caps, with a space between or else it comes up as invalid. If not, I guess I can put the e.g. in the &#34;Description&#34; and hope people follow it. Thanks.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
