<?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: Set a specific llenght for single line text</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Set a specific llenght for single line text</description>
<language>en</language>
<pubDate>Mon, 04 May 2026 08:12:08 +0000</pubDate>

<item>
<title>grisu59 on "Set a specific llenght for single line text"</title>
<link>https://www.machform.com/forums/topic/set-a-specific-llenght-for-single-line-text#post-5381</link>
<pubDate>Mon, 06 Apr 2009 20:33:02 +0000</pubDate>
<dc:creator>grisu59</dc:creator>
<guid isPermaLink="false">5381@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I will try your solution but I would like that where is the option SMALL MEDIUM MAXIMUM I could choose a free value (2, 5, 10 or other)
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Set a specific llenght for single line text"</title>
<link>https://www.machform.com/forums/topic/set-a-specific-llenght-for-single-line-text#post-5379</link>
<pubDate>Mon, 06 Apr 2009 19:38:40 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">5379@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;You need to edit &#34;includes/view-functions.php&#34; file to do so, let say you have 2 element id in form 38 with this details :&#60;/p&#62;
&#60;p&#62;1. element_1 --&#38;gt; Single text field --&#38;gt; max : 2 Char&#60;br /&#62;
2. element_2 --&#38;gt; Single text field --&#38;gt; max : 5 char &#60;/p&#62;
&#60;p&#62;Then edit your &#34;view-functions.php&#34; and go to around line 40 , you will see this code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$element_markup = &#38;lt;&#38;lt;&#38;lt;EOT&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Put these code above that line &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($_GET[&#38;#39;id&#38;#39;] == 38) {
	if ($element-&#38;gt;id == 1) {
		$max_length =  &#38;#39;maxlength=&#38;quot;2&#38;quot;&#38;#39;;
	} elseif ($element-&#38;gt;id == 2) {
		$max_length =  &#38;#39;maxlength=&#38;quot;5&#38;quot;&#38;#39;;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then go to line 51, you will see this code &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;input id=&#38;quot;element_{$element-&#38;gt;id}&#38;quot;  name=&#38;quot;element_{$element-&#38;gt;id}&#38;quot; class=&#38;quot;element text {$element-&#38;gt;size}&#38;quot;
type=&#38;quot;text&#38;quot; value=&#38;quot;{$element-&#38;gt;default_value}&#38;quot; /&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;replace with this one &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;input id=&#38;quot;element_{$element-&#38;gt;id}&#38;quot; {$max_length} name=&#38;quot;element_{$element-&#38;gt;id}&#38;quot;
class=&#38;quot;element text {$element-&#38;gt;size}&#38;quot; type=&#38;quot;text&#38;quot; value=&#38;quot;{$element-&#38;gt;default_value}&#38;quot; /&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;don't forget to change the form id and element id with yours
&#60;/p&#62;</description>
</item>
<item>
<title>grisu59 on "Set a specific llenght for single line text"</title>
<link>https://www.machform.com/forums/topic/set-a-specific-llenght-for-single-line-text#post-5366</link>
<pubDate>Mon, 06 Apr 2009 02:58:56 +0000</pubDate>
<dc:creator>grisu59</dc:creator>
<guid isPermaLink="false">5366@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;How can I set a specific lenght for a single line text field?&#60;/p&#62;
&#60;p&#62;For example I have the field of country code that is lenght=2 letter&#60;br /&#62;
I don't want that will be more space in this field&#60;/p&#62;
&#60;p&#62;In another case I have a CAP code that is lenght= 5 numbers&#60;br /&#62;
I use still a SINGLE LINE TEXT filed because I don't want it as a number&#60;/p&#62;
&#60;p&#62;So I need set lenght = 5 and allow to type in only numbers&#60;/p&#62;
&#60;p&#62;How can I do it???
&#60;/p&#62;</description>
</item>

</channel>
</rss>
