<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Validate Zip Code Field</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Validate Zip Code Field</description>
<language>en</language>
<pubDate>Tue, 05 May 2026 07:19:54 +0000</pubDate>

<item>
<title>mindseye on "Validate Zip Code Field"</title>
<link>https://www.machform.com/forums/topic/validate-zip-code-field#post-6753</link>
<pubDate>Wed, 29 Jul 2009 20:21:23 +0000</pubDate>
<dc:creator>mindseye</dc:creator>
<guid isPermaLink="false">6753@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks redityo. I appreciate your help. The form works great now.
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Validate Zip Code Field"</title>
<link>https://www.machform.com/forums/topic/validate-zip-code-field#post-6750</link>
<pubDate>Wed, 29 Jul 2009 15:03:05 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">6750@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;If you need to allow numeric value only for &#34;ZIP&#34; code, try to use this code instead :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ((strlen(trim($target_input[$element_name_5])) &#38;lt; 5 &#124;&#124; !is_numeric($target_input[$element_name_5])) &#38;#38;&#38;#38; empty($error_elements[$element_id]) ) {
	$error_elements[$element_id] = &#38;quot;Zip code must more than 5 Character&#38;quot;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I think it's more simple to use &#34;is_numeric&#34; function
&#60;/p&#62;</description>
</item>
<item>
<title>mindseye on "Validate Zip Code Field"</title>
<link>https://www.machform.com/forums/topic/validate-zip-code-field#post-6740</link>
<pubDate>Tue, 28 Jul 2009 20:12:38 +0000</pubDate>
<dc:creator>mindseye</dc:creator>
<guid isPermaLink="false">6740@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Now people are entering the state name for example &#34;Florida&#34; and since there are more than 5 characters the form is accepting this entry. &#60;/p&#62;
&#60;p&#62;I added this to the code  &#124;&#124; !preg_match(&#34;/^[0-9][\w]*$/i&#34;,$value[5])&#60;/p&#62;
&#60;p&#62;Would this work?&#60;/p&#62;
&#60;p&#62;if ($form_id == 4 &#124;&#124; $form_id == 10) {&#60;br /&#62;
	if (strlen(trim($target_input[$element_name_5])) &#38;lt; 5 &#38;#38;&#38;#38; empty($error_elements[$element_id]) &#124;&#124; !preg_match(&#34;/^[0-9][\w]*$/i&#34;,$value[5]) ) {&#60;br /&#62;
		$error_elements[$element_id] = &#34;Zip code must be more than 5 Characters&#34;;&#60;br /&#62;
	}&#60;br /&#62;
}
&#60;/p&#62;</description>
</item>
<item>
<title>mindseye on "Validate Zip Code Field"</title>
<link>https://www.machform.com/forums/topic/validate-zip-code-field#post-6687</link>
<pubDate>Thu, 23 Jul 2009 21:17:35 +0000</pubDate>
<dc:creator>mindseye</dc:creator>
<guid isPermaLink="false">6687@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Very nice. Thank you for your help.
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Validate Zip Code Field"</title>
<link>https://www.machform.com/forums/topic/validate-zip-code-field#post-6685</link>
<pubDate>Thu, 23 Jul 2009 19:24:19 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">6685@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Try to edit &#34;includes/post-functions.php&#34; file and go around line 479 ~ 481, you'll see these code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if($validation_result !== true){
	$error_elements[$element_id] = $validation_result;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then put these code exactly bellow that line &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($form_id == 5) {
	if (strlen(trim($target_input[$element_name_5])) &#38;lt; 5 &#38;#38;&#38;#38; empty($error_elements[$element_id]) ) {
		$error_elements[$element_id] = &#38;quot;Zip code must more than 5 Character&#38;quot;;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Those code will work on form id 5, make sure you change the form id with yours
&#60;/p&#62;</description>
</item>
<item>
<title>mindseye on "Validate Zip Code Field"</title>
<link>https://www.machform.com/forums/topic/validate-zip-code-field#post-6676</link>
<pubDate>Wed, 22 Jul 2009 23:23:13 +0000</pubDate>
<dc:creator>mindseye</dc:creator>
<guid isPermaLink="false">6676@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I would like to validate the zipcode field in my forms to check for a minimum of 5 characters. Currently people are adding state abbreviations in the zipcode and not getting an error message. &#60;/p&#62;
&#60;p&#62;how can I specify the validation for that field only?&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
