<?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: Default Values in Price or Date Fields</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Default Values in Price or Date Fields</description>
<language>en</language>
<pubDate>Sun, 03 May 2026 23:05:52 +0000</pubDate>

<item>
<title>yuniar on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-4371</link>
<pubDate>Thu, 22 Jan 2009 19:33:48 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">4371@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Let say you have a form with id number=27 and your price field is having id=4, and would like to put $34.99 as default value for your price field.&#60;/p&#62;
&#60;p&#62;Edit &#60;strong&#62;includes/view-functions.php&#60;/strong&#62; file, around line 825 you should find this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function display_money($element){&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;under that line, insert this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if($_REQUEST[&#38;#39;id&#38;#39;] == 27 &#38;#38;&#38;#38; $element-&#38;gt;id == 4){
	if(empty($element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id.&#38;#39;_1&#38;#39;][&#38;#39;default_value&#38;#39;])){
		$element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id.&#38;#39;_1&#38;#39;][&#38;#39;default_value&#38;#39;] = 34;
	}

	if(empty($element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id.&#38;#39;_2&#38;#39;][&#38;#39;default_value&#38;#39;])){
		$element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id.&#38;#39;_2&#38;#39;][&#38;#39;default_value&#38;#39;] = 99;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;that would set the default value for your price field.
&#60;/p&#62;</description>
</item>
<item>
<title>komita on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-4359</link>
<pubDate>Thu, 22 Jan 2009 05:11:37 +0000</pubDate>
<dc:creator>komita</dc:creator>
<guid isPermaLink="false">4359@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I want a default value for the &#34;price&#34; field and do not see that I can set that.  I can see it in number, but not price.
&#60;/p&#62;</description>
</item>
<item>
<title>rscott7706 on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-3877</link>
<pubDate>Tue, 02 Dec 2008 09:53:09 +0000</pubDate>
<dc:creator>rscott7706</dc:creator>
<guid isPermaLink="false">3877@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks redityo - I will try to look at doing this tonight or tomorrow.&#60;/p&#62;
&#60;p&#62;Thanks for the tip!!&#60;/p&#62;
&#60;p&#62;Ron
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-3873</link>
<pubDate>Mon, 01 Dec 2008 18:42:30 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">3873@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Ron,&#60;/p&#62;
&#60;p&#62;You can set default value for date element by edit &#34;inludes/view-functions.php&#34; and add these code to line 358.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id.&#38;#39;_1&#38;#39;][&#38;#39;default_value&#38;#39;] = &#38;quot;01&#38;quot;;
$element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id.&#38;#39;_2&#38;#39;][&#38;#39;default_value&#38;#39;] = &#38;quot;01&#38;quot;;
$element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id.&#38;#39;_3&#38;#39;][&#38;#39;default_value&#38;#39;] = &#38;quot;1990&#38;quot;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;it should give your date field with 01/01/1990
&#60;/p&#62;</description>
</item>
<item>
<title>rscott7706 on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-3868</link>
<pubDate>Mon, 01 Dec 2008 10:44:36 +0000</pubDate>
<dc:creator>rscott7706</dc:creator>
<guid isPermaLink="false">3868@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;redityo&#60;/p&#62;
&#60;p&#62;I am not good at explaining sometimes, there will be sections in the form that get filled out if one condition exists and another section filled out if another situation exists - and they both will have a date field.  So, in order to legitimately instruct the client to &#34;Skip&#34; a section, I must pre-populate all the date fields.&#60;/p&#62;
&#60;p&#62;So, both sections contain a date field for instance.  They both need to be populated with default values so, when the form is submitted it will pass the &#34;required&#34; validation.  One field gets re-written with to proper date for the section applicable to the client, the other remains.&#60;/p&#62;
&#60;p&#62;I hope this makes sense.&#60;/p&#62;
&#60;p&#62;Saghalie&#60;br /&#62;
I do find that telephone fields have a &#34;default&#34; option, so this is solved, but date fields do not have a &#34;default&#34; option.  Hence my situation.&#60;/p&#62;
&#60;p&#62;Thanks All - I hope  explained that better.  &#60;/p&#62;
&#60;p&#62;Here is a link that may help: &#60;a href=&#34;http://www.masterliens.biz/machform/view.php?id=4&#34; rel=&#34;nofollow&#34;&#62;http://www.masterliens.biz/machform/view.php?id=4&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Ron
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-3863</link>
<pubDate>Mon, 01 Dec 2008 09:09:06 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">3863@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;For default values, just fill in the &#34;Default Value&#34; section under field properties.&#60;/p&#62;
&#60;p&#62;I would suggest putting in there &#34;Not Applicable&#34; or just &#34;NA&#34;.&#60;/p&#62;
&#60;p&#62;Saghalie.
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-3861</link>
<pubDate>Mon, 01 Dec 2008 08:17:22 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">3861@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Ron,&#60;/p&#62;
&#60;p&#62;What the condition to customer should fill the date and price field or not ?
&#60;/p&#62;</description>
</item>
<item>
<title>rscott7706 on "Default Values in Price or Date Fields"</title>
<link>https://www.machform.com/forums/topic/default-values-in-price-or-date-fields#post-3851</link>
<pubDate>Sun, 30 Nov 2008 03:22:37 +0000</pubDate>
<dc:creator>rscott7706</dc:creator>
<guid isPermaLink="false">3851@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi folks,  &#60;/p&#62;
&#60;p&#62;I have some forms that are sectioned.  If a client has one need, they fill in a particular section.  If another need, they skip to another section.  As I am also using required fields in the different sections, this creates a problem.&#60;/p&#62;
&#60;p&#62;I have several fields that should be required, such as date and price fields.  But, if I make them required, the clients then would be forced to populate fields in sections not applicable to them.  (Price or Date fields).&#60;/p&#62;
&#60;p&#62;Is there a way I can make all date or price fields pre-populate with a value?  For date fields, a simple 1/1/2008 would be fine (or what ever 01/01/2008, etc.) and for price, a simple 1 dollar would be fine.&#60;/p&#62;
&#60;p&#62;If not is there any way to get the fields (as I build them) to except some default value?&#60;/p&#62;
&#60;p&#62;Thanks!!&#60;/p&#62;
&#60;p&#62;Ron
&#60;/p&#62;</description>
</item>

</channel>
</rss>
