<?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: limit number of fields by user</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: limit number of fields by user</description>
<language>en</language>
<pubDate>Wed, 06 May 2026 06:43:54 +0000</pubDate>

<item>
<title>redityo on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2357</link>
<pubDate>Tue, 15 Jul 2008 13:53:01 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">2357@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;you can change this code &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$rules[$element_name][&#38;#39;blank&#38;#39;] = true;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;to&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($form_id == 1) {$rules[$element_name][&#38;#39;blank&#38;#39;] = true; }&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and thank you for suggestion :D
&#60;/p&#62;</description>
</item>
<item>
<title>walags on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2356</link>
<pubDate>Tue, 15 Jul 2008 13:38:41 +0000</pubDate>
<dc:creator>walags</dc:creator>
<guid isPermaLink="false">2356@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;man yall are good. at a minimum yall should have a paypal donate button for custom stuff like this.&#60;/p&#62;
&#60;p&#62;i don't see it being an issue since i will only have one form active at a time, but can i limit this new requirement to a specific form number?
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2355</link>
<pubDate>Tue, 15 Jul 2008 13:30:43 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">2355@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm sorry my bad ..&#60;/p&#62;
&#60;p&#62;the code in that line supposed like this around line 630 ~ 632&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//add rules blank
$rules[$element_name][&#38;#39;blank&#38;#39;] 	= true; 

$target_input[$element_name] = $element_data;

$validation_result = validate_element($target_input,$rules);

if($validation_result !== true){
	if ($validation_result !== &#38;quot;BLANK&#38;quot;)
		$error_elements[$element_id] = $validation_result;
	else
		$selectRequiredCount++;

}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>walags on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2354</link>
<pubDate>Tue, 15 Jul 2008 13:17:06 +0000</pubDate>
<dc:creator>walags</dc:creator>
<guid isPermaLink="false">2354@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;do you have another piece of code i need to add? i'm not too sure how everything is set up but i don't see where you called validate_blank function. $selectRequiredCount remains zero.&#60;/p&#62;
&#60;p&#62;if you have these two files working can you just email them to wal_ags at yahoo?
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2353</link>
<pubDate>Tue, 15 Jul 2008 13:05:54 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">2353@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Really ?  have you put bellow code to include/common-validator.php , and try echo the $selectRequiredCount in line 948 it should show the value.  &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//validation for blank
function validate_blank($value){
	$value = $value[0];

	if(empty($value)) { //0  and &#38;#39;0&#38;#39; should not considered as empty
		return &#38;#39;BLANK&#38;#39;;
	}else{
		return true;
	}
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>walags on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2351</link>
<pubDate>Tue, 15 Jul 2008 12:23:11 +0000</pubDate>
<dc:creator>walags</dc:creator>
<guid isPermaLink="false">2351@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Wow, thanks for the quick response. It is not currently working for me. I edited the error message to output the $selectRequiredCount value. It doesn't appear that this variable is being incremented.&#60;/p&#62;
&#60;p&#62;Where does the new function validate_blank get called?
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2350</link>
<pubDate>Tue, 15 Jul 2008 11:16:56 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">2350@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi ..&#60;/p&#62;
&#60;p&#62;From your case you only want user to fill 10 from 50 Drop down right? you can try this  modification to your machform :&#60;/p&#62;
&#60;p&#62;1. modify includes/post-functions.php&#60;/p&#62;
&#60;p&#62;#bellow line 131 &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//count variable
$selectRequiredCount = 0;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;#between line 630 ~ 632, replace&#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;to&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//add rule blank check
$rules[$element_name][&#38;#39;blank&#38;#39;] 	= true; 

if($validation_result !== true){
	if ($validation_result !== &#38;quot;BLANK&#38;quot;)
		$error_elements[$element_id] = $validation_result;
	else
		$selectRequiredCount++;

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;#in line 948, add&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($selectRequiredCount &#38;lt;&#38;gt; 40) {
	$process_result[&#38;#39;status&#38;#39;] = false;
	$process_result[&#38;#39;custom_error&#38;#39;] = &#38;quot;you must fill 10 entries&#38;quot;;

	return $process_result;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;2. modify include/common-validator.php&#60;/p&#62;
&#60;p&#62;#in line 39&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//validation for blank
function validate_blank($value){
	$value = $value[0];

	if(empty($value)) { //0  and &#38;#39;0&#38;#39; should not considered as empty
		return &#38;#39;BLANK&#38;#39;;
	}else{
		return true;
	}
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>walags on "[closed] limit number of fields by user"</title>
<link>https://www.machform.com/forums/topic/limit-number-of-fields-by-user#post-2349</link>
<pubDate>Tue, 15 Jul 2008 08:45:49 +0000</pubDate>
<dc:creator>walags</dc:creator>
<guid isPermaLink="false">2349@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;This is what I would like to accomplish...say you have 50 drop down fields and you only want a user selecting a response for 10 of them, where do I start?&#60;/p&#62;
&#60;p&#62;I am assuming there is an easy function to see if a field is empty or not. Similar to the checking in place for required fields, I want to count how many fields are empty and prevent the user from submitting if it is more or less then I say so. In the example above I would want to have a total of 40 empty fields...no more no less.&#60;/p&#62;
&#60;p&#62;Could you see a function like this work in this environment?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
