<?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: Enable Code in Admin Only Fields?</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Enable Code in Admin Only Fields?</description>
<language>en</language>
<pubDate>Sat, 20 Jun 2026 18:33:30 +0000</pubDate>

<item>
<title>vern1271 on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-7776</link>
<pubDate>Mon, 26 Oct 2009 20:17:47 +0000</pubDate>
<dc:creator>vern1271</dc:creator>
<guid isPermaLink="false">7776@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;OK, sent. Thanks!
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-7767</link>
<pubDate>Sat, 24 Oct 2009 18:28:07 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">7767@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm... can you send me the two URL to your forms?&#60;br /&#62;
Also send me your view-functions.php file&#60;/p&#62;
&#60;p&#62;I'll check and test it.&#60;br /&#62;
Please mail to: customer.service [at] appnitro.com
&#60;/p&#62;</description>
</item>
<item>
<title>vern1271 on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-7761</link>
<pubDate>Fri, 23 Oct 2009 19:42:02 +0000</pubDate>
<dc:creator>vern1271</dc:creator>
<guid isPermaLink="false">7761@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;No, I hid the field using CSS using display:none;.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-7760</link>
<pubDate>Fri, 23 Oct 2009 15:50:58 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">7760@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Is &#60;strong&#62;element_6&#60;/strong&#62; an admin-only field?&#60;/p&#62;
&#60;p&#62;If so, you need to be logged in to your machform admin panel first.
&#60;/p&#62;</description>
</item>
<item>
<title>vern1271 on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-7752</link>
<pubDate>Thu, 22 Oct 2009 02:25:49 +0000</pubDate>
<dc:creator>vern1271</dc:creator>
<guid isPermaLink="false">7752@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;OK, I followed the steps above. I have a hidden field(element_06) in form 13. Here is the code I'm using in view-functions.php:&#60;/p&#62;
&#60;p&#62;//check for populated value, if exist, use it instead default_value&#60;br /&#62;
		if(isset($element-&#38;gt;populated_value['element_'.$element-&#38;gt;id]['default_value'])){&#60;br /&#62;
			$element-&#38;gt;default_value = $element-&#38;gt;populated_value['element_'.$element-&#38;gt;id]['default_value'];&#60;br /&#62;
		}&#60;br /&#62;
		if(($_REQUEST['id'] == 13) &#38;#38;&#38;#38; ($element-&#38;gt;id == 6)){&#60;br /&#62;
			$element-&#38;gt;default_value = $_SESSION['form_data']['element_1'];&#60;br /&#62;
			}&#60;/p&#62;
&#60;p&#62;As you can see I'm trying to pre-populate element_06 from a session variable set from the previous form (element_01), but it's not working for me&#60;/p&#62;
&#60;p&#62;I know the session is working... I checked it using &#38;lt;?php print_r($_SESSION['form_data']); ?&#38;gt;.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-547</link>
<pubDate>Fri, 11 Jan 2008 14:25:31 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">547@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;ok got it. I've replied back.
&#60;/p&#62;</description>
</item>
<item>
<title>epsd on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-543</link>
<pubDate>Thu, 10 Jan 2008 05:37:25 +0000</pubDate>
<dc:creator>epsd</dc:creator>
<guid isPermaLink="false">543@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'll send it first thing in the morning. It does send the value when the field is set to 'view by everyone' just not when admin only.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-523</link>
<pubDate>Tue, 08 Jan 2008 06:29:41 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">523@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm..that's weird, if the field contains the value already, it should be posted to the database. Can you send me the HTML code of this form? &#60;/p&#62;
&#60;p&#62;Send me your view-functions.php file too, or any other modified files.
&#60;/p&#62;</description>
</item>
<item>
<title>epsd on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-521</link>
<pubDate>Tue, 08 Jan 2008 00:20:28 +0000</pubDate>
<dc:creator>epsd</dc:creator>
<guid isPermaLink="false">521@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Sorry, I was out for the weekend...The field contains the value (i.e., I can see it on-screen), but it doesn't get posted to the database (or sent in an email) when the field is set to admin only. It works fine (i.e., is sent to the DB) when the field is set as 'everyone'. &#60;/p&#62;
&#60;p&#62;I can't give you the URL as it is on a secured intranet... I can send you the view-functions.php file if you'd like.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-513</link>
<pubDate>Sat, 05 Jan 2008 10:28:22 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">513@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm..what doesn't work? The 'admin only' field shows blank value?&#60;br /&#62;
It seems tricky to continue in the forum. &#60;/p&#62;
&#60;p&#62;Could you please mail me the following:&#60;br /&#62;
- includes/view-functions.php file&#60;br /&#62;
- your machform URL&#60;br /&#62;
- your machform username + password&#60;/p&#62;
&#60;p&#62;Send them to yuniar [at] appnitro.com&#60;br /&#62;
I'll take a look.
&#60;/p&#62;</description>
</item>
<item>
<title>epsd on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-512</link>
<pubDate>Fri, 04 Jan 2008 20:22:07 +0000</pubDate>
<dc:creator>epsd</dc:creator>
<guid isPermaLink="false">512@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm using the code in regular fields and it now works fine, however, it doesn't work in admin only fields... I have installed the updated bug-fix for admin only fields (which has fixed most of the bug, except for the above for some reason).
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-509</link>
<pubDate>Fri, 04 Jan 2008 05:50:31 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">509@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Simply right click on your form and view source.&#60;br /&#62;
The element name would be the actual HTML element name.
&#60;/p&#62;</description>
</item>
<item>
<title>epsd on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-506</link>
<pubDate>Thu, 03 Jan 2008 20:09:50 +0000</pubDate>
<dc:creator>epsd</dc:creator>
<guid isPermaLink="false">506@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;sounds easy enough. how do I determine the element name? Is it just what I've named it or is it from my database? Thanks for your help!!
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-498</link>
<pubDate>Thu, 03 Jan 2008 13:35:55 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">498@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm..I'm afraid it won't be as simple as turning off a feature.&#60;/p&#62;
&#60;p&#62;You will need to modify the specific function which display the fields.&#60;br /&#62;
All of them are placed in &#60;strong&#62;includes/view-functions.php&#60;/strong&#62;&#60;/p&#62;
&#60;p&#62;Ok, let say we have a form with form_id = 12 and a 'Single Line Text' field which is set to 'admin only' and has element name &#60;strong&#62;element_3&#60;/strong&#62;.&#60;/p&#62;
&#60;p&#62;To get your session variable into that field. Edit &#60;strong&#62;display_text()&#60;/strong&#62; function. Around line 29 you will find this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//check for populated value, if exist, use it instead default_value
if(!empty($element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id][&#38;#39;default_value&#38;#39;])){
	$element-&#38;gt;default_value = $element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id][&#38;#39;default_value&#38;#39;];
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;&#60;/code&#62;&#60;br /&#62;
Right under that block of code, add this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if(($_REQUEST[&#38;#39;id&#38;#39;] == 12) &#38;#38;&#38;#38; ($element-&#38;gt;id == 3)){
	$element-&#38;gt;default_value = $_SESSION[&#38;#39;your_session_var&#38;#39;];
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;&#60;/code&#62;&#60;br /&#62;
That should set the default value for that particular 'admin only' field to be the same as your session variable.&#60;/p&#62;
&#60;p&#62;I hope I'm being clear for you.&#60;br /&#62;
Please feel free to ask any question you might have.
&#60;/p&#62;</description>
</item>
<item>
<title>epsd on "Enable Code in Admin Only Fields?"</title>
<link>https://www.machform.com/forums/topic/enable-code-in-admin-only-fields#post-495</link>
<pubDate>Thu, 03 Jan 2008 01:56:22 +0000</pubDate>
<dc:creator>epsd</dc:creator>
<guid isPermaLink="false">495@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Just installed under SSL and what a relief it is to have a program like this! Anyway, I have some variables that are being passed from page to page in sessions. I modded the app so that it sees this session data. Works fine. Now, I'd like to get that session data (just a username for example) into an admin only field. In hand coded forms, I'd simply do a php echo of the variable in the value. &#60;/p&#62;
&#60;p&#62;However, machforms just displays the code and not the variable. I realize that this is for security purposes. Is there a way that I can turn off some of this security for the admin only fields? I'm running in a secure environment so I'm not too concerned about it...
&#60;/p&#62;</description>
</item>

</channel>
</rss>
