<?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 Upload Field?</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Validate Upload Field?</description>
<language>en</language>
<pubDate>Mon, 04 May 2026 03:47:34 +0000</pubDate>

<item>
<title>redityo on "Validate Upload Field?"</title>
<link>https://www.machform.com/forums/topic/validate-upload-field#post-9809</link>
<pubDate>Mon, 28 Jun 2010 19:22:14 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">9809@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;It's possible with some customization. But you need to turn on &#34;review page&#34; option for this. To do this, you need to edit &#34;view-functions.php&#34; file, try to follow these steps :&#60;/p&#62;
&#60;p&#62;1. Go to around line 2331 ~ 2445, you'll see these code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$toggle = false;
foreach ($entry_details as $data){
	if($toggle){
		$toggle = false;
		$row_style = &#38;#39;class=&#38;quot;alt&#38;quot;&#38;#39;;
	}else{
		$toggle = true;
		$row_style = &#38;#39;&#38;#39;;
	}	

	$entry_data .= &#38;quot;&#38;lt;tr {$row_style}&#38;gt;\n&#38;quot;;
	$entry_data .= &#38;quot;&#38;lt;td width=\&#38;quot;40%\&#38;quot;&#38;gt;&#38;lt;strong&#38;gt;{$data[&#38;#39;label&#38;#39;]}&#38;lt;/strong&#38;gt;&#38;lt;/td&#38;gt;\n&#38;quot;;
	$entry_data .= &#38;quot;&#38;lt;td width=\&#38;quot;60%\&#38;quot;&#38;gt;&#38;quot;.nl2br($data[&#38;#39;value&#38;#39;]).&#38;quot;&#38;lt;/td&#38;gt;\n&#38;quot;;
	$entry_data .= &#38;quot;&#38;lt;/tr&#38;gt;\n&#38;quot;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then replace the code with these one &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$toggle = false;
$file_check = false;
foreach ($entry_details as $data){
	if($toggle){
		$toggle = false;
		$row_style = &#38;#39;class=&#38;quot;alt&#38;quot;&#38;#39;;
	}else{
		$toggle = true;
		$row_style = &#38;#39;&#38;#39;;
	}	

	if ($data[&#38;#39;element_type&#38;#39;] == &#38;#39;file&#38;#39;) {
		if (substr(strip_tags($data[&#38;#39;value&#38;#39;] ),-3) == &#38;#39;jpg&#38;#39;) {
			$file_check = true;
		}
	}

	$entry_data .= &#38;quot;&#38;lt;tr {$row_style}&#38;gt;\n&#38;quot;;
	$entry_data .= &#38;quot;&#38;lt;td width=\&#38;quot;40%\&#38;quot;&#38;gt;&#38;lt;strong&#38;gt;{$data[&#38;#39;label&#38;#39;]}&#38;lt;/strong&#38;gt;&#38;lt;/td&#38;gt;\n&#38;quot;;
	$entry_data .= &#38;quot;&#38;lt;td width=\&#38;quot;60%\&#38;quot;&#38;gt;&#38;quot;.nl2br($data[&#38;#39;value&#38;#39;]).&#38;quot;&#38;lt;/td&#38;gt;\n&#38;quot;;
	$entry_data .= &#38;quot;&#38;lt;/tr&#38;gt;\n&#38;quot;;
}   	

if ($file_check == true) {
	$on_confirm =  &#38;#39;onclick = &#38;quot;return confirm(\&#38;#39;Are you sure you want to upload one image? \&#38;#39;); &#38;quot;&#38;#39;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;2. Go to around line 2400 for this code &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;input id=&#38;quot;review_submit&#38;quot; class=&#38;quot;button_text&#38;quot; type=&#38;quot;submit&#38;quot; name=&#38;quot;review_submit&#38;quot; value=&#38;quot;{$lang[&#38;#39;submit_button&#38;#39;]}&#38;quot; /&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then change it to&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;input {$on_confirm} id=&#38;quot;review_submit&#38;quot; class=&#38;quot;button_text&#38;quot; type=&#38;quot;submit&#38;quot; name=&#38;quot;review_submit&#38;quot; value=&#38;quot;{$lang[&#38;#39;submit_button&#38;#39;]}&#38;quot; /&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That would give a confirmation to &#34;submit&#34; button when one of uploaded file type is &#34;jpg&#34;
&#60;/p&#62;</description>
</item>
<item>
<title>drumaboy46 on "Validate Upload Field?"</title>
<link>https://www.machform.com/forums/topic/validate-upload-field#post-9805</link>
<pubDate>Sun, 27 Jun 2010 23:08:04 +0000</pubDate>
<dc:creator>drumaboy46</dc:creator>
<guid isPermaLink="false">9805@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I just wanted to know if there was a way to validate the upload field for example.&#60;/p&#62;
&#60;p&#62;If the file ends in .jpg have a message that says, &#34;Are you sure you want to upload one image.&#34;&#60;/p&#62;
&#60;p&#62;Since the upload field does not support multiple files to one field. Currently I have instructed my users to zip the folder in order to send me all there files in one file.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
