<?xml version="1.0" encoding="UTF-8"?>
<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><![CDATA[Form Tools - Form Validation: JS + PHP]]></title>
		<link>https://forums.formtools.org/</link>
		<description><![CDATA[Form Tools - https://forums.formtools.org]]></description>
		<pubDate>Mon, 13 Apr 2026 13:07:30 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Problem with initializing array in RSV in jQuery?]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=26771</link>
			<pubDate>Mon, 31 Jul 2017 08:22:46 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=26771</guid>
			<description><![CDATA[I'm using the RSV jQuery plugin, so if this is the incorrect place to post this question, please let me know where I should take this inquiry.<br />
<br />
I have a <span style="font-style: italic;" class="mycode_i">very</span> complicated form involving validation rules that change depending upon which radio button a user selects.<br />
<br />
It's all working fine <span style="font-style: italic;" class="mycode_i">except</span> in the use-case scenario where someone "changes their mind" and clicks a <span style="font-style: italic;" class="mycode_i">different</span> radio button. The rules change as expected and everything seems to work fine, but there appears to be some "bleed-through" of the validation rules from the earlier radio button selection.<br />
<br />
I only noticed this because one of the radio button selections has a larger overall set of rules than the other. When I choose the larger and then change to the smaller, it still validates against the larger's rules.<br />
<br />
I'm doing all this with a jQuery bind("change") if/else statement:<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"[name=submissionType]"</span><span style="color: #007700">).</span><span style="color: #0000BB">bind</span><span style="color: #007700">(</span><span style="color: #DD0000">"change"</span><span style="color: #007700">, function() {<br />
</span><span style="color: #0000BB">        if </span><span style="color: #007700">(&#36;(</span><span style="color: #0000BB">this</span><span style="color: #007700">).</span><span style="color: #0000BB">val</span><span style="color: #007700">() == </span><span style="color: #DD0000">'Submission_Event'</span><span style="color: #007700">) {<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#EventInformation"</span><span style="color: #007700">).</span><span style="color: #0000BB">show</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#OWUDailyCalendarForm"</span><span style="color: #007700">).</span><span style="color: #0000BB">RSV</span><span style="color: #007700">({<br />
</span><span style="color: #0000BB">                displayType</span><span style="color: #007700">: </span><span style="color: #DD0000">"alert-one"</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                rules</span><span style="color: #007700">:[</span><span style="color: #DD0000">"required,firstName,Please enter the OWU contact's first name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,lastName,Please enter the OWU contact's last name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"custom_alpha,phoneNumber,xxx-xxx-xxxx,Please enter your phone number in the format ###-###-####."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddress,Please enter the OWU contact's personal email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddress,.*@owu&#092;.edu&#36;,Please enter a valid personal OWU email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddressForPublication,Please enter an OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddressForPublication,.*@owu&#092;.edu&#36;,Please enter a valid OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUSponsoringOrganizationOffice,Please enter the OWU sponsoring organization/office."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,category,Please select a category for your submission."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,submissionType,Please select whether your submission is an event or a non-event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,eventNameTitle,Please enter the name / title of your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,eventLocation,Please select the location for your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,startDateTime,Please select the start date and time for your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,endDateTime,Please select the end date and time for your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyHeadline,Please enter a headline for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyDescription,Please enter a short description for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,firstPublicationDate,Please select the first publication date for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,roomReservationAcknowledgement&#092;[&#092;],You must acknowledge your room reservation in order to submit this form."<br />
</span><span style="color: #0000BB">                </span><span style="color: #007700">]<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">});<br />
</span><span style="color: #0000BB">        </span><span style="color: #007700">}<br />
</span><span style="color: #0000BB">        else </span><span style="color: #007700">if (&#36;(</span><span style="color: #0000BB">this</span><span style="color: #007700">).</span><span style="color: #0000BB">val</span><span style="color: #007700">() == </span><span style="color: #DD0000">'Submission_Non-Event'</span><span style="color: #007700">) {<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#EventInformation"</span><span style="color: #007700">).</span><span style="color: #0000BB">hide</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#OWUDailyCalendarForm"</span><span style="color: #007700">).</span><span style="color: #0000BB">RSV</span><span style="color: #007700">({<br />
</span><span style="color: #0000BB">                displayType</span><span style="color: #007700">: </span><span style="color: #DD0000">"alert-one"</span><span style="color: #007700">,</span><span style="color: #0000BB">                <br />
                rules</span><span style="color: #007700">: [</span><span style="color: #DD0000">"required,firstName,Please enter the OWU contact's first name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,lastName,Please enter the OWU contact's last name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"custom_alpha,phoneNumber,xxx-xxx-xxxx,Please enter your phone number in the format ###-###-####."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddress,Please enter the OWU contact's personal email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddress,.*@owu&#092;.edu&#36;,Please enter a valid personal OWU email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddressForPublication,Please enter an OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddressForPublication,.*@owu&#092;.edu&#36;,Please enter a valid OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUSponsoringOrganizationOffice,Please enter the OWU sponsoring organization/office."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,category,Please select a category for your submission."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,submissionType,Please select whether your submission is an event or a non-event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyHeadline,Please enter a headline for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyDescription,Please enter a short description for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,firstPublicationDate,Please select the first publication date for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,roomReservationAcknowledgement&#092;[&#092;],You must acknowledge your room reservation in order to submit this form."<br />
</span><span style="color: #0000BB">                </span><span style="color: #007700">]<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">});<br />
</span><span style="color: #0000BB">        </span><span style="color: #007700">} <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Basically, it's evaluating a particular radio button's value and then branching out via if/else to set the RSV instance displayType and rules settings and whatnot. Each branch has <span style="font-style: italic;" class="mycode_i">all</span> of the validation rules that are needed, so in theory it <span style="font-style: italic;" class="mycode_i">should</span> work (right?)<br />
<br />
After I select the radio button that says it is an event, then the validation rules for event "win" (since they're lengthier?), even if I later change the radio button to be a non-event.<br />
<br />
If my hunch about this is correct, then the fix should be for me to clear out the "rules" array somehow, but I've tried a half dozen different standard methods for array-clearing, as well as multiple different positions within the code (beyond the code that's mentioned above), but nothing seems to work.<br />
<br />
I <span style="font-style: italic;" class="mycode_i">thought</span> that RSV would <span style="font-style: italic;" class="mycode_i">already</span> clear out the rules array when its defined, but apparently that's not the case?<br />
<br />
Anyway, if <span style="font-style: italic;" class="mycode_i">anyone</span> can provide <span style="font-style: italic;" class="mycode_i">any</span> help with this, it would be greatly appreciated. It's one of those things that nobody noticed for nearly a <span style="font-style: italic;" class="mycode_i">year</span> (I originally created this form <span style="font-style: italic;" class="mycode_i">last</span> summer) but now that someone's found it, of course it has cropped up several times for various people.<br />
<br />
Doug Thompson<br />
Manager of Web and Electronic Communications<br />
Ohio Wesleyan University]]></description>
			<content:encoded><![CDATA[I'm using the RSV jQuery plugin, so if this is the incorrect place to post this question, please let me know where I should take this inquiry.<br />
<br />
I have a <span style="font-style: italic;" class="mycode_i">very</span> complicated form involving validation rules that change depending upon which radio button a user selects.<br />
<br />
It's all working fine <span style="font-style: italic;" class="mycode_i">except</span> in the use-case scenario where someone "changes their mind" and clicks a <span style="font-style: italic;" class="mycode_i">different</span> radio button. The rules change as expected and everything seems to work fine, but there appears to be some "bleed-through" of the validation rules from the earlier radio button selection.<br />
<br />
I only noticed this because one of the radio button selections has a larger overall set of rules than the other. When I choose the larger and then change to the smaller, it still validates against the larger's rules.<br />
<br />
I'm doing all this with a jQuery bind("change") if/else statement:<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"[name=submissionType]"</span><span style="color: #007700">).</span><span style="color: #0000BB">bind</span><span style="color: #007700">(</span><span style="color: #DD0000">"change"</span><span style="color: #007700">, function() {<br />
</span><span style="color: #0000BB">        if </span><span style="color: #007700">(&#36;(</span><span style="color: #0000BB">this</span><span style="color: #007700">).</span><span style="color: #0000BB">val</span><span style="color: #007700">() == </span><span style="color: #DD0000">'Submission_Event'</span><span style="color: #007700">) {<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#EventInformation"</span><span style="color: #007700">).</span><span style="color: #0000BB">show</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#OWUDailyCalendarForm"</span><span style="color: #007700">).</span><span style="color: #0000BB">RSV</span><span style="color: #007700">({<br />
</span><span style="color: #0000BB">                displayType</span><span style="color: #007700">: </span><span style="color: #DD0000">"alert-one"</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                rules</span><span style="color: #007700">:[</span><span style="color: #DD0000">"required,firstName,Please enter the OWU contact's first name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,lastName,Please enter the OWU contact's last name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"custom_alpha,phoneNumber,xxx-xxx-xxxx,Please enter your phone number in the format ###-###-####."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddress,Please enter the OWU contact's personal email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddress,.*@owu&#092;.edu&#36;,Please enter a valid personal OWU email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddressForPublication,Please enter an OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddressForPublication,.*@owu&#092;.edu&#36;,Please enter a valid OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUSponsoringOrganizationOffice,Please enter the OWU sponsoring organization/office."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,category,Please select a category for your submission."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,submissionType,Please select whether your submission is an event or a non-event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,eventNameTitle,Please enter the name / title of your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,eventLocation,Please select the location for your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,startDateTime,Please select the start date and time for your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,endDateTime,Please select the end date and time for your event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyHeadline,Please enter a headline for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyDescription,Please enter a short description for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,firstPublicationDate,Please select the first publication date for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,roomReservationAcknowledgement&#092;[&#092;],You must acknowledge your room reservation in order to submit this form."<br />
</span><span style="color: #0000BB">                </span><span style="color: #007700">]<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">});<br />
</span><span style="color: #0000BB">        </span><span style="color: #007700">}<br />
</span><span style="color: #0000BB">        else </span><span style="color: #007700">if (&#36;(</span><span style="color: #0000BB">this</span><span style="color: #007700">).</span><span style="color: #0000BB">val</span><span style="color: #007700">() == </span><span style="color: #DD0000">'Submission_Non-Event'</span><span style="color: #007700">) {<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#EventInformation"</span><span style="color: #007700">).</span><span style="color: #0000BB">hide</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">&#36;(</span><span style="color: #DD0000">"#OWUDailyCalendarForm"</span><span style="color: #007700">).</span><span style="color: #0000BB">RSV</span><span style="color: #007700">({<br />
</span><span style="color: #0000BB">                displayType</span><span style="color: #007700">: </span><span style="color: #DD0000">"alert-one"</span><span style="color: #007700">,</span><span style="color: #0000BB">                <br />
                rules</span><span style="color: #007700">: [</span><span style="color: #DD0000">"required,firstName,Please enter the OWU contact's first name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,lastName,Please enter the OWU contact's last name."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"custom_alpha,phoneNumber,xxx-xxx-xxxx,Please enter your phone number in the format ###-###-####."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddress,Please enter the OWU contact's personal email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddress,.*@owu&#092;.edu&#36;,Please enter a valid personal OWU email address."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,emailAddressForPublication,Please enter an OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"reg_exp,emailAddressForPublication,.*@owu&#092;.edu&#36;,Please enter a valid OWU email address for publication."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUSponsoringOrganizationOffice,Please enter the OWU sponsoring organization/office."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,category,Please select a category for your submission."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,submissionType,Please select whether your submission is an event or a non-event."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyHeadline,Please enter a headline for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,OWUDailyDescription,Please enter a short description for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,firstPublicationDate,Please select the first publication date for your OWU Daily entry."</span><span style="color: #007700">,<br />
</span><span style="color: #0000BB">                </span><span style="color: #DD0000">"required,roomReservationAcknowledgement&#092;[&#092;],You must acknowledge your room reservation in order to submit this form."<br />
</span><span style="color: #0000BB">                </span><span style="color: #007700">]<br />
</span><span style="color: #0000BB">            </span><span style="color: #007700">});<br />
</span><span style="color: #0000BB">        </span><span style="color: #007700">} <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Basically, it's evaluating a particular radio button's value and then branching out via if/else to set the RSV instance displayType and rules settings and whatnot. Each branch has <span style="font-style: italic;" class="mycode_i">all</span> of the validation rules that are needed, so in theory it <span style="font-style: italic;" class="mycode_i">should</span> work (right?)<br />
<br />
After I select the radio button that says it is an event, then the validation rules for event "win" (since they're lengthier?), even if I later change the radio button to be a non-event.<br />
<br />
If my hunch about this is correct, then the fix should be for me to clear out the "rules" array somehow, but I've tried a half dozen different standard methods for array-clearing, as well as multiple different positions within the code (beyond the code that's mentioned above), but nothing seems to work.<br />
<br />
I <span style="font-style: italic;" class="mycode_i">thought</span> that RSV would <span style="font-style: italic;" class="mycode_i">already</span> clear out the rules array when its defined, but apparently that's not the case?<br />
<br />
Anyway, if <span style="font-style: italic;" class="mycode_i">anyone</span> can provide <span style="font-style: italic;" class="mycode_i">any</span> help with this, it would be greatly appreciated. It's one of those things that nobody noticed for nearly a <span style="font-style: italic;" class="mycode_i">year</span> (I originally created this form <span style="font-style: italic;" class="mycode_i">last</span> summer) but now that someone's found it, of course it has cropped up several times for various people.<br />
<br />
Doug Thompson<br />
Manager of Web and Electronic Communications<br />
Ohio Wesleyan University]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Google Maps Error]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=26764</link>
			<pubDate>Mon, 31 Jul 2017 04:57:55 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=26764</guid>
			<description><![CDATA[Hello guys, <br />
<br />
Im getting a error using Google Maps Module, when I opem any form, I have an error.<br />
<br />
<img src="http://ana.soccsantos.ovh/google.png" width="800" height="640" alt="[Image: google.png]" class="mycode_img" /><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forums.formtools.org/images/attachtypes/image.gif" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=191" target="_blank" title="">google.png</a> (Size: 120.96 KB / Downloads: 2)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Hello guys, <br />
<br />
Im getting a error using Google Maps Module, when I opem any form, I have an error.<br />
<br />
<img src="http://ana.soccsantos.ovh/google.png" width="800" height="640" alt="[Image: google.png]" class="mycode_img" /><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forums.formtools.org/images/attachtypes/image.gif" title="PNG Image" border="0" alt=".png" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=191" target="_blank" title="">google.png</a> (Size: 120.96 KB / Downloads: 2)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Validation help for a NooB (JS?)]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=21714</link>
			<pubDate>Sat, 25 Feb 2017 12:13:49 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=21714</guid>
			<description><![CDATA[I have created a form, and it is working great!<br />
The only thing I would like to do is prevent duplicate text box entries for a certain field (empire_name) <br />
<br />
The form is FormBuilder type, Published<br />
<br />
For what I am reading I need to use the JS validation method?<br />
<a href="https://docs.formtools.org/userdoc/field_validation/?page=edit_field_dialog" target="_blank" class="mycode_url">https://docs.formtools.org/userdoc/field...eld_dialog</a><br />
<a href="https://docs.formtools.org/tutorials/js_validation/" target="_blank" class="mycode_url">https://docs.formtools.org/tutorials/js_validation/</a><br />
<br />
How / Where do I make the changes?<br />
I seem to be missing something, probably simple....<br />
<br />
Thanks!<br />
<br />
Mike]]></description>
			<content:encoded><![CDATA[I have created a form, and it is working great!<br />
The only thing I would like to do is prevent duplicate text box entries for a certain field (empire_name) <br />
<br />
The form is FormBuilder type, Published<br />
<br />
For what I am reading I need to use the JS validation method?<br />
<a href="https://docs.formtools.org/userdoc/field_validation/?page=edit_field_dialog" target="_blank" class="mycode_url">https://docs.formtools.org/userdoc/field...eld_dialog</a><br />
<a href="https://docs.formtools.org/tutorials/js_validation/" target="_blank" class="mycode_url">https://docs.formtools.org/tutorials/js_validation/</a><br />
<br />
How / Where do I make the changes?<br />
I seem to be missing something, probably simple....<br />
<br />
Thanks!<br />
<br />
Mike]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Repeating subforms - PDF -> Formtools]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=18674</link>
			<pubDate>Mon, 19 Dec 2016 03:56:59 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=18674</guid>
			<description><![CDATA[Hi, I have some forms, created in Livecycle Designer, and I was able to transfer the forms from PDF into Formtools. The forms are working well.<br />
But in the PDF forms I had some sections that were repeating subforms, you could say there was a one to many relationship between the form and the subforms.<br />
In the case of submitting external data from the PDF forms, if some subforms are active, in the HTTP POST submission, only the last instance of the subform is submitted into the database.<br />
This is probably due to a duplicate validation.<br />
Now, I see that subforms feature is not available  in Formtools.<br />
What I would like to do is to submit the duplicate information contained into the subforms in a different table, that will have a one to many relationship with the main form, so I need to know, what files are involved in the process of inserting the external form data into the database, including TPL files, because I  would like to modify the views as well, in order to be able to view the subforms as well.<br />
You know your application best, and could help me get started, compared to me getting to understand the hole programming of the Formtools application.<br />
So I need a point where to start.<br />
I hope I'll get an answer.<br />
<br />
Thank you!]]></description>
			<content:encoded><![CDATA[Hi, I have some forms, created in Livecycle Designer, and I was able to transfer the forms from PDF into Formtools. The forms are working well.<br />
But in the PDF forms I had some sections that were repeating subforms, you could say there was a one to many relationship between the form and the subforms.<br />
In the case of submitting external data from the PDF forms, if some subforms are active, in the HTTP POST submission, only the last instance of the subform is submitted into the database.<br />
This is probably due to a duplicate validation.<br />
Now, I see that subforms feature is not available  in Formtools.<br />
What I would like to do is to submit the duplicate information contained into the subforms in a different table, that will have a one to many relationship with the main form, so I need to know, what files are involved in the process of inserting the external form data into the database, including TPL files, because I  would like to modify the views as well, in order to be able to view the subforms as well.<br />
You know your application best, and could help me get started, compared to me getting to understand the hole programming of the Formtools application.<br />
So I need a point where to start.<br />
I hope I'll get an answer.<br />
<br />
Thank you!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Opposite of same_as]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=12822</link>
			<pubDate>Wed, 18 May 2016 14:30:17 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=12822</guid>
			<description><![CDATA[Hey guys -<br />
<br />
Not sure if this can be done with reg_exp or not, but I'd like to create a PHP validation rule that is exactly the opposite of same_as. For example, on a form, the customer is allowed to choose their 1st choice and their 2nd choice, but I don't want to let them choose the SAME choice in both fields. Each of the 1st and 2nd choices needs to be different from each other. Any thoughts?<br />
<br />
B<br />
<hr class="mycode_hr" />
I can see in the validation.php file where the same_as rule is written, and I could easily just create another case in that file, but I want to make sure it never gets overwritten (you know, like a WP child theme's functions.php).<br />
<br />
<span style="font-weight: bold;" class="mycode_b">/global/code/validation.php:367-370</span><br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">case </span><span style="color: #DD0000">"same_as"</span><span style="color: #007700">:<br />
        if (</span><span style="color: #0000BB">&#36;fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">] != </span><span style="color: #0000BB">&#36;fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name2</span><span style="color: #007700">])<br />
          </span><span style="color: #0000BB">&#36;errors</span><span style="color: #007700">[] = </span><span style="color: #0000BB">&#36;error_message</span><span style="color: #007700">;<br />
        break; <br />
</span><span style="color: #0000BB"></code></div></pre></div></div>]]></description>
			<content:encoded><![CDATA[Hey guys -<br />
<br />
Not sure if this can be done with reg_exp or not, but I'd like to create a PHP validation rule that is exactly the opposite of same_as. For example, on a form, the customer is allowed to choose their 1st choice and their 2nd choice, but I don't want to let them choose the SAME choice in both fields. Each of the 1st and 2nd choices needs to be different from each other. Any thoughts?<br />
<br />
B<br />
<hr class="mycode_hr" />
I can see in the validation.php file where the same_as rule is written, and I could easily just create another case in that file, but I want to make sure it never gets overwritten (you know, like a WP child theme's functions.php).<br />
<br />
<span style="font-weight: bold;" class="mycode_b">/global/code/validation.php:367-370</span><br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php <br />
</span><span style="color: #007700">case </span><span style="color: #DD0000">"same_as"</span><span style="color: #007700">:<br />
        if (</span><span style="color: #0000BB">&#36;fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">] != </span><span style="color: #0000BB">&#36;fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name2</span><span style="color: #007700">])<br />
          </span><span style="color: #0000BB">&#36;errors</span><span style="color: #007700">[] = </span><span style="color: #0000BB">&#36;error_message</span><span style="color: #007700">;<br />
        break; <br />
</span><span style="color: #0000BB"></code></div></pre></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Can Form Tools check data entry consistency this way?]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=10786</link>
			<pubDate>Mon, 14 Dec 2015 16:44:15 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=10786</guid>
			<description><![CDATA[I'm learning to create forms and wondering if Form Tools can help with this type of data validation.<br />
<br />
In the questionnaire I'm working with, there's a question like this:<br />
<br />
What was your facility's total revenue last year?<br />
And a bunch of following questions asking about sources of that revenue, e.g.:<br />
<br />
- Of which, how much came from sales?<br />
<br />
- Of which, how much came from services?<br />
<br />
etc.<br />
<br />
Can Form Tools ensure data entry consistency for questions like this? For example, at the end of entry of individual sources of revenue, I want to perform a summation across those sources. If they don't add up to be equal to total revenue, there will be a pop-up message, e.g., "Data entry inconsistency. Please ensure that individual sources add up to be equal to the total revenue." The respondents can choose to "Return" to start again from the Total revenue field, or to "Proceed anyway", acknowledging that there's some issue with their data quality.<br />
<br />
As a further specification, is it possible to specify such summation only over valid values? For example, if respondents are not sure or don't know about some individual revenue source, they can fill in, say, -1 for that field. I hence only want summation over non-negative values.]]></description>
			<content:encoded><![CDATA[I'm learning to create forms and wondering if Form Tools can help with this type of data validation.<br />
<br />
In the questionnaire I'm working with, there's a question like this:<br />
<br />
What was your facility's total revenue last year?<br />
And a bunch of following questions asking about sources of that revenue, e.g.:<br />
<br />
- Of which, how much came from sales?<br />
<br />
- Of which, how much came from services?<br />
<br />
etc.<br />
<br />
Can Form Tools ensure data entry consistency for questions like this? For example, at the end of entry of individual sources of revenue, I want to perform a summation across those sources. If they don't add up to be equal to total revenue, there will be a pop-up message, e.g., "Data entry inconsistency. Please ensure that individual sources add up to be equal to the total revenue." The respondents can choose to "Return" to start again from the Total revenue field, or to "Proceed anyway", acknowledging that there's some issue with their data quality.<br />
<br />
As a further specification, is it possible to specify such summation only over valid values? For example, if respondents are not sure or don't know about some individual revenue source, they can fill in, say, -1 for that field. I hence only want summation over non-negative values.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Validate on Custom field]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5324</link>
			<pubDate>Wed, 02 Sep 2015 15:14:30 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5324</guid>
			<description><![CDATA[I need to create a field, the field should be inserted only a value between 18 and 70 , I do not know where to do it. Tried putting range = 18-70 in the Custom Function , the custom filed but did not work<br />
<br />
Ty]]></description>
			<content:encoded><![CDATA[I need to create a field, the field should be inserted only a value between 18 and 70 , I do not know where to do it. Tried putting range = 18-70 in the Custom Function , the custom filed but did not work<br />
<br />
Ty]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Email Validation or Confirm Email]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5221</link>
			<pubDate>Fri, 26 Jun 2015 04:43:07 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5221</guid>
			<description><![CDATA[Hi,<br />
<br />
Is there anyone to make your email field to validate or confirm to the second email field like the attached image.<br />
<br />
If anyone can help would be appreciate! <img src="https://forums.formtools.org/images/smilies/smile.gif" alt="Smile" title="Smile" class="smilie smilie_1" /><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forums.formtools.org/images/attachtypes/image.gif" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=177" target="_blank" title="">confirmemail.jpg</a> (Size: 19.42 KB / Downloads: 18)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
Is there anyone to make your email field to validate or confirm to the second email field like the attached image.<br />
<br />
If anyone can help would be appreciate! <img src="https://forums.formtools.org/images/smilies/smile.gif" alt="Smile" title="Smile" class="smilie smilie_1" /><br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="https://forums.formtools.org/images/attachtypes/image.gif" title="JPG Image" border="0" alt=".jpg" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=177" target="_blank" title="">confirmemail.jpg</a> (Size: 19.42 KB / Downloads: 18)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SQL Error two different web sites]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5210</link>
			<pubDate>Sun, 14 Jun 2015 15:14:14 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5210</guid>
			<description><![CDATA[I have tried to install Forms 2.0 on two different web sites I have going. Doing set up I run into an error at the <span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">EXACT </span></span>same step for <span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">each </span></span>web site.<br />
<br />
I set up a detailed step by step explanation of my process for my web hosts to look at.  They haven't come up with an answer yet.<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Here is the step by step of what happens:</span></span><br />
<a href="http://gatesoforegon.com/ERROR-for-webdevel-forms-set-up-problem.html" target="_blank" class="mycode_url">gatesoforegon.com/ERROR-for-webdevel-forms-set-up-problem.html</a><br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Here are the two web sites contact pages in question:</span></span><br />
<a href="http://ehmotorsports.net/contact.html" target="_blank" class="mycode_url">http://ehmotorsports.net/contact.html</a><br />
<a href="http://contact-page.html" target="_blank" class="mycode_url">http://contact-page.html</a><a href="http://gatesoforegon.com/contact-page.html" target="_blank" class="mycode_url">gatesoforegon.com/contact-page.html</a><br />
<br />
If you click on the submit button on each form (above links), you will see it takes you to the proper Forms Toll Acceptance page.<br />
<br />
<br />
If someone could help, would appreciate it!<br />
<br />
Warmest regards,<br />
<br />
Greg]]></description>
			<content:encoded><![CDATA[I have tried to install Forms 2.0 on two different web sites I have going. Doing set up I run into an error at the <span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">EXACT </span></span>same step for <span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">each </span></span>web site.<br />
<br />
I set up a detailed step by step explanation of my process for my web hosts to look at.  They haven't come up with an answer yet.<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Here is the step by step of what happens:</span></span><br />
<a href="http://gatesoforegon.com/ERROR-for-webdevel-forms-set-up-problem.html" target="_blank" class="mycode_url">gatesoforegon.com/ERROR-for-webdevel-forms-set-up-problem.html</a><br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Here are the two web sites contact pages in question:</span></span><br />
<a href="http://ehmotorsports.net/contact.html" target="_blank" class="mycode_url">http://ehmotorsports.net/contact.html</a><br />
<a href="http://contact-page.html" target="_blank" class="mycode_url">http://contact-page.html</a><a href="http://gatesoforegon.com/contact-page.html" target="_blank" class="mycode_url">gatesoforegon.com/contact-page.html</a><br />
<br />
If you click on the submit button on each form (above links), you will see it takes you to the proper Forms Toll Acceptance page.<br />
<br />
<br />
If someone could help, would appreciate it!<br />
<br />
Warmest regards,<br />
<br />
Greg]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Validation on external forms]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5209</link>
			<pubDate>Fri, 12 Jun 2015 14:14:10 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5209</guid>
			<description><![CDATA[Does validation work on external forms?  Or does it only work for the form builder. I'm trying to add validation for the email field and it doesn't validate. Some guidance would be much appreciated.]]></description>
			<content:encoded><![CDATA[Does validation work on external forms?  Or does it only work for the form builder. I'm trying to add validation for the email field and it doesn't validate. Some guidance would be much appreciated.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Receiving blank results on a required field]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5148</link>
			<pubDate>Tue, 05 May 2015 17:22:56 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5148</guid>
			<description><![CDATA[We have a form using drop down selections.  I set the fields as mandatory in Formtools 2.<br />
<br />
We intentionally made the first choice a blank so that they would HAVE to make a selection.  Appears this blank IS a selection.<br />
<br />
How can I fix this so that they MUST chose a selection from the drop down, but there is nothing selected to start with.<br />
<br />
Here what I have:<br />
<br />
Course Title:&lt;select name="Course_Title"&gt;<br />
&lt;option value=" "&gt;&lt;/option&gt;<br />
&lt;option value="Torts I s2"&gt;Torts I 6:00 (Viselman)&lt;/option&gt;<br />
&lt;option value="Torts I s3"&gt;Torts I 7:30 (Chang)&lt;/option&gt;<br />
&lt;option value="Contracts II s2"&gt;Contracts II 6:00 (Shabani)&lt;/option&gt;<br />
&lt;option value="Contracts II s3"&gt;Contracts II 7:30 (Shabani)&lt;/option&gt;<br />
&lt;option value="Criminal Law"&gt;Criminal Law (Barreto)&lt;/option&gt;<br />
&lt;option value="Legal Writing and Analysis"&gt;Legal Writing &amp;amp; Analysis (Zunker)&lt;/option&gt;<br />
&lt;option value="Constitutional Law I"&gt;Constitutional Law I (Zunker)&lt;/option&gt;<br />
&lt;option value="Civil Procedure I"&gt;Civil Procedure I (Watkins)&lt;/option&gt;<br />
&lt;option value="Criminal Procedure"&gt;Criminal Procedure (Barreto)&lt;/option&gt;<br />
&lt;option value="Bar Review"&gt;Bar Review (Watkins)&lt;/option&gt;<br />
<br />
jeff.bosset@californiaschooloflaw.com]]></description>
			<content:encoded><![CDATA[We have a form using drop down selections.  I set the fields as mandatory in Formtools 2.<br />
<br />
We intentionally made the first choice a blank so that they would HAVE to make a selection.  Appears this blank IS a selection.<br />
<br />
How can I fix this so that they MUST chose a selection from the drop down, but there is nothing selected to start with.<br />
<br />
Here what I have:<br />
<br />
Course Title:&lt;select name="Course_Title"&gt;<br />
&lt;option value=" "&gt;&lt;/option&gt;<br />
&lt;option value="Torts I s2"&gt;Torts I 6:00 (Viselman)&lt;/option&gt;<br />
&lt;option value="Torts I s3"&gt;Torts I 7:30 (Chang)&lt;/option&gt;<br />
&lt;option value="Contracts II s2"&gt;Contracts II 6:00 (Shabani)&lt;/option&gt;<br />
&lt;option value="Contracts II s3"&gt;Contracts II 7:30 (Shabani)&lt;/option&gt;<br />
&lt;option value="Criminal Law"&gt;Criminal Law (Barreto)&lt;/option&gt;<br />
&lt;option value="Legal Writing and Analysis"&gt;Legal Writing &amp;amp; Analysis (Zunker)&lt;/option&gt;<br />
&lt;option value="Constitutional Law I"&gt;Constitutional Law I (Zunker)&lt;/option&gt;<br />
&lt;option value="Civil Procedure I"&gt;Civil Procedure I (Watkins)&lt;/option&gt;<br />
&lt;option value="Criminal Procedure"&gt;Criminal Procedure (Barreto)&lt;/option&gt;<br />
&lt;option value="Bar Review"&gt;Bar Review (Watkins)&lt;/option&gt;<br />
<br />
jeff.bosset@californiaschooloflaw.com]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Add a textbox validation rule via the Custom Fields module interface]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=5081</link>
			<pubDate>Fri, 13 Mar 2015 12:13:25 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=5081</guid>
			<description><![CDATA[Hello,<br />
<br />
A newbie question:<br />
<br />
I am trying to find a way to check the content of various textbox fiels on my form so as to ensure that they contain a number. If the number has decimal digits, those should be separated by a dot (not by a comma that often people use).<br />
<br />
For that, I am trying to use the Custom Fields module. I have created a new field type ("test"), based on the Textbox field type. I would like to add a validation rule that would use a regular expression for the validation of the textbox, which in my case would be "/^\d*\.{0,1}\d*\z/".<br />
<br />
I assume that, for an external form I would use something like <br />
rules.push("reg_exp,field_name,'/^\d*\.{0,1}\d*\z/',Error message");<br />
However, how could I do that using the interface of the Custom Fields module? The form that I plan to use this validation on is an internal one.<br />
<br />
Thanks in advance for your help!<br />
G.<br />
<br />
PS <br />
In the mean time, I have managed to go around the problem. I have used a Hooks rule for "ft_create_blank_submission, end" and an identical one for "ft_update_sumbission, end", which goes through the &#36;_POST fields that should have numbers, checks that the strings have number values, changes the commas to dots and then updates the content of the fieds prior to submission.<br />
However, changing the user input in that way, is something that I would like to avoid.]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
A newbie question:<br />
<br />
I am trying to find a way to check the content of various textbox fiels on my form so as to ensure that they contain a number. If the number has decimal digits, those should be separated by a dot (not by a comma that often people use).<br />
<br />
For that, I am trying to use the Custom Fields module. I have created a new field type ("test"), based on the Textbox field type. I would like to add a validation rule that would use a regular expression for the validation of the textbox, which in my case would be "/^\d*\.{0,1}\d*\z/".<br />
<br />
I assume that, for an external form I would use something like <br />
rules.push("reg_exp,field_name,'/^\d*\.{0,1}\d*\z/',Error message");<br />
However, how could I do that using the interface of the Custom Fields module? The form that I plan to use this validation on is an internal one.<br />
<br />
Thanks in advance for your help!<br />
G.<br />
<br />
PS <br />
In the mean time, I have managed to go around the problem. I have used a Hooks rule for "ft_create_blank_submission, end" and an identical one for "ft_update_sumbission, end", which goes through the &#36;_POST fields that should have numbers, checks that the strings have number values, changes the commas to dots and then updates the content of the fieds prior to submission.<br />
However, changing the user input in that way, is something that I would like to avoid.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[No ReCaptcha error returned...]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=4541</link>
			<pubDate>Thu, 07 Aug 2014 15:12:05 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=4541</guid>
			<description><![CDATA[As the subject implies, I have gotten everything working EXCEPT am getting no error message when the wrong code is put in. Correct code = successfuly submission.<br />
<br />
I have gone through the guide at <a href="http://docs.formtools.org/tutorials/post_form_captchas/" target="_blank" class="mycode_url">http://docs.formtools.org/tutorials/post_form_captchas/</a> but am at a loss. Any idea on why the error message is not getting returned?<br />
<br />
Thanks for your help!]]></description>
			<content:encoded><![CDATA[As the subject implies, I have gotten everything working EXCEPT am getting no error message when the wrong code is put in. Correct code = successfuly submission.<br />
<br />
I have gone through the guide at <a href="http://docs.formtools.org/tutorials/post_form_captchas/" target="_blank" class="mycode_url">http://docs.formtools.org/tutorials/post_form_captchas/</a> but am at a loss. Any idea on why the error message is not getting returned?<br />
<br />
Thanks for your help!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[drop-down menu is not validation]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=3133</link>
			<pubDate>Tue, 01 Jul 2014 01:46:51 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=3133</guid>
			<description><![CDATA[hello <br />
the drop-down menu is not validation and do not know how to do, can you help me .. thanks]]></description>
			<content:encoded><![CDATA[hello <br />
the drop-down menu is not validation and do not know how to do, can you help me .. thanks]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[After submit blank Process.php]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=2900</link>
			<pubDate>Thu, 06 Feb 2014 08:17:22 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=2900</guid>
			<description><![CDATA[I hope I am close to getting this form working.  When the user clicks submit we go to a blank Process.php page, however the results are correctly sent to Form Tools.  I dohave a redirect specified in Form Tools for this form, but it doesnt go past process.php.<br />
<br />
I am new to CMSMS and Formtools so thanks in advance for any help in resolving this problem.<br />
<br />
Here is my process.php:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php<br />
<br />
</span><span style="color: #FF8000">/**<br />
 * File: process.php<br />
 *<br />
 * This file processes any form submissions for forms already added and configured within Form Tools. To<br />
 * use it, just point your form to this file, like so:<br />
 *<br />
 *   &lt;form method="post" action="/path/to/process.php"&gt;<br />
 *<br />
 * Once the form has been added through the Form Tools UI, this script parses the form contents<br />
 * and adds it to the database then redirects the user to whatever page is required. In addition,<br />
 * this script is used to initially set up the form within the database, to map input fields to<br />
 * database columns and types.<br />
 */<br />
<br />
<br />
// always include the core library functions<br />
</span><span style="color: #0000BB">&#36;folder </span><span style="color: #007700">= </span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />
require_once(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;folder</span><span style="color: #DD0000">/global/library.php"</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// if the API is supplied, include it as well<br />
</span><span style="color: #0000BB">&#36;folder </span><span style="color: #007700">= </span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />
@include_once(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;folder</span><span style="color: #DD0000">/global/api/api.php"</span><span style="color: #007700">);<br />
<br />
<br />
</span><span style="color: #FF8000">// check we're receiving something<br />
</span><span style="color: #007700">if (empty(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">))<br />
{<br />
  </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_post_vars"</span><span style="color: #007700">]);<br />
  </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
  exit;<br />
}<br />
<br />
</span><span style="color: #FF8000">// check there's a form ID included<br />
</span><span style="color: #007700">else if (empty(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_id"</span><span style="color: #007700">]))<br />
{<br />
  </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_form_id"</span><span style="color: #007700">]);<br />
  </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
  exit;<br />
}<br />
<br />
</span><span style="color: #FF8000">// is this an initialization submission?<br />
</span><span style="color: #007700">else if (isset(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_initialize_form"</span><span style="color: #007700">]))<br />
  </span><span style="color: #0000BB">ft_initialize_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// otherwise, it's a regular form submission. Process it!<br />
</span><span style="color: #007700">else<br />
  </span><span style="color: #0000BB">ft_process_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// -------------------------------------------------------------------------------------------------<br />
<br />
/**<br />
 * This function processes the form submissions, after the form has been set up in the database.<br />
 */<br />
</span><span style="color: #007700">function </span><span style="color: #0000BB">ft_process_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">)<br />
{<br />
  global </span><span style="color: #0000BB">&#36;g_table_prefix</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_multi_val_delimiter</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_query_str_multi_val_separator</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_root_dir</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">,<br />
    </span><span style="color: #0000BB">&#36;g_api_version</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_api_recaptcha_private_key</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #FF8000">// ensure the incoming values are escaped<br />
  </span><span style="color: #0000BB">&#36;form_data </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_sanitize</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">);<br />
<br />
  </span><span style="color: #0000BB">&#36;form_id </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_id"</span><span style="color: #007700">];<br />
  </span><span style="color: #0000BB">&#36;form_info </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">);<br />
<br />
  </span><span style="color: #FF8000">// do we have a form for this id?<br />
  </span><span style="color: #007700">if (!</span><span style="color: #0000BB">ft_check_form_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_invalid_form_id"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #0000BB">extract</span><span style="color: #007700">(</span><span style="color: #0000BB">ft_process_hook_calls</span><span style="color: #007700">(</span><span style="color: #DD0000">"start"</span><span style="color: #007700">, </span><span style="color: #0000BB">compact</span><span style="color: #007700">(</span><span style="color: #DD0000">"form_info"</span><span style="color: #007700">, </span><span style="color: #DD0000">"form_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"form_data"</span><span style="color: #007700">), array(</span><span style="color: #DD0000">"form_data"</span><span style="color: #007700">)), </span><span style="color: #0000BB">EXTR_OVERWRITE</span><span style="color: #007700">);<br />
<br />
  </span><span style="color: #FF8000">// check to see if this form has been completely set up<br />
  </span><span style="color: #007700">if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_complete"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no"</span><span style="color: #007700">)<br />
  {<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_form_incomplete"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// check to see if this form has been disabled<br />
  </span><span style="color: #007700">if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_active"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no"</span><span style="color: #007700">)<br />
  {<br />
    if (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_inactive_form_redirect_url"</span><span style="color: #007700">]))<br />
    {<br />
      </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location: </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_inactive_form_redirect_url"</span><span style="color: #007700">]}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br />
      exit;<br />
    }<br />
<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_form_disabled"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// do we have a form for this id?<br />
  </span><span style="color: #007700">if (!</span><span style="color: #0000BB">ft_check_form_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_invalid_form_id"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
<br />
  </span><span style="color: #FF8000">// was there a reCAPTCHA response? If so, a recaptcha was just submitted. This generally implies the<br />
  // form page included the API, so check it was entered correctly. If not, return the user to the webpage<br />
  </span><span style="color: #007700">if (isset(</span><span style="color: #0000BB">&#36;g_api_version</span><span style="color: #007700">) &amp;&amp; isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"recaptcha_response_field"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;passes_captcha </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />
    </span><span style="color: #0000BB">&#36;recaptcha_challenge_field </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"recaptcha_challenge_field"</span><span style="color: #007700">];<br />
    </span><span style="color: #0000BB">&#36;recaptcha_response_field  </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"recaptcha_response_field"</span><span style="color: #007700">];<br />
<br />
    </span><span style="color: #0000BB">&#36;folder </span><span style="color: #007700">= </span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />
    require_once(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;folder</span><span style="color: #DD0000">/global/api/recaptchalib.php"</span><span style="color: #007700">);<br />
<br />
    </span><span style="color: #0000BB">&#36;resp </span><span style="color: #007700">= </span><span style="color: #0000BB">recaptcha_check_answer</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;g_api_recaptcha_private_key</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"REMOTE_ADDR"</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;recaptcha_challenge_field</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;recaptcha_response_field</span><span style="color: #007700">);<br />
<br />
    if (</span><span style="color: #0000BB">&#36;resp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">is_valid</span><span style="color: #007700">)<br />
      </span><span style="color: #0000BB">&#36;passes_captcha </span><span style="color: #007700">= </span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />
    else<br />
    {<br />
      </span><span style="color: #FF8000">// since we need to pass all the info back to the form page we do it by storing the data in sessions. Enable 'em.<br />
      </span><span style="color: #007700">@</span><span style="color: #0000BB">ft_api_start_sessions</span><span style="color: #007700">();<br />
      </span><span style="color: #0000BB">&#36;_SESSION</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_data"</span><span style="color: #007700">] = </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">;<br />
      </span><span style="color: #0000BB">&#36;_SESSION</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_data"</span><span style="color: #007700">][</span><span style="color: #DD0000">"api_recaptcha_error"</span><span style="color: #007700">] = </span><span style="color: #0000BB">&#36;resp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">error</span><span style="color: #007700">;<br />
<br />
      </span><span style="color: #FF8000">// if there's a form_tools_form_url specified, redirect to that<br />
      </span><span style="color: #007700">if (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_url"</span><span style="color: #007700">]))<br />
      {<br />
        </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location: </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_url"</span><span style="color: #007700">]}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br />
        exit;<br />
      }<br />
      </span><span style="color: #FF8000">// if not, see if the server has the redirect URL specified<br />
      </span><span style="color: #007700">else if (isset(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"HTTP_REFERER"</span><span style="color: #007700">]))<br />
      {<br />
        </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location: </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"HTTP_REFERER"</span><span style="color: #007700">]}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br />
        exit;<br />
      }<br />
      </span><span style="color: #FF8000">// no luck! Throw an error<br />
      </span><span style="color: #007700">else<br />
      {<br />
        </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_form_url_for_recaptcha"</span><span style="color: #007700">]);<br />
        </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
        exit;<br />
      }<br />
    }<br />
  }<br />
<br />
<br />
  </span><span style="color: #FF8000">// get a list of the custom form fields (i.e. non-system) for this form<br />
  </span><span style="color: #0000BB">&#36;form_fields </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_form_fields</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">, array(</span><span style="color: #DD0000">"include_field_type_info" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">true</span><span style="color: #007700">));<br />
<br />
  </span><span style="color: #0000BB">&#36;custom_form_fields </span><span style="color: #007700">= array();<br />
  </span><span style="color: #0000BB">&#36;file_fields </span><span style="color: #007700">= array();<br />
  foreach (</span><span style="color: #0000BB">&#36;form_fields </span><span style="color: #007700">as </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">)<br />
  {<br />
    </span><span style="color: #0000BB">&#36;field_id        </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_id"</span><span style="color: #007700">];<br />
    </span><span style="color: #0000BB">&#36;is_system_field </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_system_field"</span><span style="color: #007700">];<br />
    </span><span style="color: #0000BB">&#36;field_name      </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_name"</span><span style="color: #007700">];<br />
<br />
    </span><span style="color: #FF8000">// ignore system fields<br />
    </span><span style="color: #007700">if (</span><span style="color: #0000BB">&#36;is_system_field </span><span style="color: #007700">== </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
      continue;<br />
<br />
    if (</span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_file_field"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no"</span><span style="color: #007700">)<br />
    {<br />
      </span><span style="color: #0000BB">&#36;custom_form_fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">] = array(<br />
        </span><span style="color: #DD0000">"field_id"    </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_id</span><span style="color: #007700">,<br />
        </span><span style="color: #DD0000">"col_name"    </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"col_name"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"field_title" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_title"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"include_on_redirect" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"include_on_redirect"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"field_type_id" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_type_id"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"is_date_field" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_date_field"</span><span style="color: #007700">]<br />
      );<br />
    }<br />
    else<br />
    {<br />
      </span><span style="color: #0000BB">&#36;file_fields</span><span style="color: #007700">[] = array(<br />
        </span><span style="color: #DD0000">"field_id"   </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_id</span><span style="color: #007700">,<br />
        </span><span style="color: #DD0000">"field_info" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info<br />
      </span><span style="color: #007700">);<br />
    }<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// now examine the contents of the POST/GET submission and get a list of those fields<br />
  // which we're going to update<br />
  </span><span style="color: #0000BB">&#36;valid_form_fields </span><span style="color: #007700">= array();<br />
  while (list(</span><span style="color: #0000BB">&#36;form_field</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">) = </span><span style="color: #0000BB">each</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">))<br />
  {<br />
    </span><span style="color: #FF8000">// if this field is included, store the value for adding to DB<br />
    </span><span style="color: #007700">if (</span><span style="color: #0000BB">array_key_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_field</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;custom_form_fields</span><span style="color: #007700">))<br />
    {<br />
      </span><span style="color: #0000BB">&#36;curr_form_field </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;custom_form_fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;form_field</span><span style="color: #007700">];<br />
<br />
      </span><span style="color: #0000BB">&#36;cleaned_value </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">;<br />
      if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">))<br />
      {<br />
        if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"submission_strip_tags"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
        {<br />
          for (</span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">; </span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">); </span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">++)<br />
            </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">] = </span><span style="color: #0000BB">strip_tags</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">]);<br />
        }<br />
<br />
        </span><span style="color: #0000BB">&#36;cleaned_value </span><span style="color: #007700">= </span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;g_multi_val_delimiter</span><span style="color: #DD0000">"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">);<br />
      }<br />
      else<br />
      {<br />
        if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"submission_strip_tags"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
          </span><span style="color: #0000BB">&#36;cleaned_value </span><span style="color: #007700">= </span><span style="color: #0000BB">strip_tags</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">);<br />
      }<br />
<br />
      </span><span style="color: #0000BB">&#36;valid_form_fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;curr_form_field</span><span style="color: #007700">[</span><span style="color: #DD0000">"col_name"</span><span style="color: #007700">]] = </span><span style="color: #DD0000">"'</span><span style="color: #0000BB">&#36;cleaned_value</span><span style="color: #DD0000">'"</span><span style="color: #007700">;<br />
    }<br />
  }<br />
<br />
  </span><span style="color: #0000BB">&#36;now </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_current_datetime</span><span style="color: #007700">();<br />
  </span><span style="color: #0000BB">&#36;ip_address </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"REMOTE_ADDR"</span><span style="color: #007700">];<br />
<br />
  </span><span style="color: #0000BB">&#36;col_names </span><span style="color: #007700">= </span><span style="color: #0000BB">array_keys</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;valid_form_fields</span><span style="color: #007700">);<br />
  </span><span style="color: #0000BB">&#36;col_names_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">", "</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;col_names</span><span style="color: #007700">);<br />
  if (!empty(</span><span style="color: #0000BB">&#36;col_names_str</span><span style="color: #007700">))<br />
    </span><span style="color: #0000BB">&#36;col_names_str </span><span style="color: #007700">.= </span><span style="color: #DD0000">", "</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #0000BB">&#36;col_values </span><span style="color: #007700">= </span><span style="color: #0000BB">array_values</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;valid_form_fields</span><span style="color: #007700">);<br />
  </span><span style="color: #0000BB">&#36;col_values_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">", "</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;col_values</span><span style="color: #007700">);<br />
  if (!empty(</span><span style="color: #0000BB">&#36;col_values_str</span><span style="color: #007700">))<br />
    </span><span style="color: #0000BB">&#36;col_values_str </span><span style="color: #007700">.= </span><span style="color: #DD0000">", "</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #FF8000">// build our query<br />
  </span><span style="color: #0000BB">&#36;query </span><span style="color: #007700">= </span><span style="color: #DD0000">"<br />
    INSERT INTO </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;g_table_prefix</span><span style="color: #007700">}</span><span style="color: #DD0000">form_</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #DD0000"> (</span><span style="color: #0000BB">&#36;col_names_str</span><span style="color: #DD0000"> submission_date, last_modified_date, ip_address, is_finalized)<br />
    VALUES (</span><span style="color: #0000BB">&#36;col_values_str</span><span style="color: #DD0000"> '</span><span style="color: #0000BB">&#36;now</span><span style="color: #DD0000">', '</span><span style="color: #0000BB">&#36;now</span><span style="color: #DD0000">', '</span><span style="color: #0000BB">&#36;ip_address</span><span style="color: #DD0000">', 'yes')<br />
           "</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #FF8000">// add the submission to the database (if form_tools_ignore_submission key isn't set by either the form or a module)<br />
  </span><span style="color: #0000BB">&#36;submission_id </span><span style="color: #007700">= </span><span style="color: #DD0000">""</span><span style="color: #007700">;<br />
  if (!isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_ignore_submission"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;result </span><span style="color: #007700">= </span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;query</span><span style="color: #007700">);<br />
<br />
    if (!</span><span style="color: #0000BB">&#36;result</span><span style="color: #007700">)<br />
    {<br />
      </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"error_code" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">304</span><span style="color: #007700">, </span><span style="color: #DD0000">"error_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"system"</span><span style="color: #007700">,<br />
        </span><span style="color: #DD0000">"debugging"</span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"Failed query in &lt;b&gt;" </span><span style="color: #007700">. </span><span style="color: #0000BB">__FUNCTION__ </span><span style="color: #007700">. </span><span style="color: #DD0000">", " </span><span style="color: #007700">. </span><span style="color: #0000BB">__FILE__ </span><span style="color: #007700">. </span><span style="color: #DD0000">"&lt;/b&gt;, line " </span><span style="color: #007700">. </span><span style="color: #0000BB">__LINE__ </span><span style="color: #007700">.<br />
            </span><span style="color: #DD0000">": &lt;i&gt;" </span><span style="color: #007700">. </span><span style="color: #0000BB">nl2br</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;query</span><span style="color: #007700">) . </span><span style="color: #DD0000">"&lt;/i&gt;"</span><span style="color: #007700">, </span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br />
      </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
      exit;<br />
    }<br />
<br />
    </span><span style="color: #0000BB">&#36;submission_id </span><span style="color: #007700">= </span><span style="color: #0000BB">mysql_insert_id</span><span style="color: #007700">();<br />
    </span><span style="color: #0000BB">extract</span><span style="color: #007700">(</span><span style="color: #0000BB">ft_process_hook_calls</span><span style="color: #007700">(</span><span style="color: #DD0000">"end"</span><span style="color: #007700">, </span><span style="color: #0000BB">compact</span><span style="color: #007700">(</span><span style="color: #DD0000">"form_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"submission_id"</span><span style="color: #007700">), array()), </span><span style="color: #0000BB">EXTR_OVERWRITE</span><span style="color: #007700">);<br />
  }<br />
<br />
<br />
  </span><span style="color: #0000BB">&#36;redirect_query_params </span><span style="color: #007700">= array();<br />
<br />
  </span><span style="color: #FF8000">// build the redirect query parameter array<br />
  </span><span style="color: #007700">foreach (</span><span style="color: #0000BB">&#36;form_fields </span><span style="color: #007700">as </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">)<br />
  {<br />
    if (</span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"include_on_redirect"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no" </span><span style="color: #007700">|| </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_file_field"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
      continue;<br />
<br />
    switch (</span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"col_name"</span><span style="color: #007700">])<br />
    {<br />
      case </span><span style="color: #DD0000">"submission_id"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"submission_id=</span><span style="color: #0000BB">&#36;submission_id</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />
        break;<br />
      case </span><span style="color: #DD0000">"submission_date"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;settings </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_settings</span><span style="color: #007700">();<br />
        </span><span style="color: #0000BB">&#36;submission_date_formatted </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_date</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_timezone_offset"</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;now</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_date_format"</span><span style="color: #007700">]);<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"submission_date=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;submission_date_formatted</span><span style="color: #007700">);<br />
        break;<br />
      case </span><span style="color: #DD0000">"last_modified_date"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;settings </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_settings</span><span style="color: #007700">();<br />
        </span><span style="color: #0000BB">&#36;submission_date_formatted </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_date</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_timezone_offset"</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;now</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_date_format"</span><span style="color: #007700">]);<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"last_modified_date=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;submission_date_formatted</span><span style="color: #007700">);<br />
        break;<br />
      case </span><span style="color: #DD0000">"ip_address"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"ip_address=</span><span style="color: #0000BB">&#36;ip_address</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />
        break;<br />
<br />
      default:<br />
        </span><span style="color: #0000BB">&#36;field_name </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_name"</span><span style="color: #007700">];<br />
<br />
        </span><span style="color: #FF8000">// if &#36;value is an array, convert it to a string, separated by &#36;g_query_str_multi_val_separator<br />
        </span><span style="color: #007700">if (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]))<br />
        {<br />
          if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]))<br />
          {<br />
            </span><span style="color: #0000BB">&#36;value_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;g_query_str_multi_val_separator</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]);<br />
            </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #DD0000">=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value_str</span><span style="color: #007700">);<br />
          }<br />
          else<br />
            </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #DD0000">=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]);<br />
        }<br />
        break;<br />
    }<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// only upload files &amp; send emails if we're not ignoring the submission<br />
  </span><span style="color: #007700">if (!isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_ignore_submission"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #FF8000">// now process any file fields. This is placed after the redirect query param code block above to allow whatever file upload<br />
    // module to append the filename to the query string, if needed<br />
    </span><span style="color: #0000BB">extract</span><span style="color: #007700">(</span><span style="color: #0000BB">ft_process_hook_calls</span><span style="color: #007700">(</span><span style="color: #DD0000">"manage_files"</span><span style="color: #007700">, </span><span style="color: #0000BB">compact</span><span style="color: #007700">(</span><span style="color: #DD0000">"form_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"submission_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"file_fields"</span><span style="color: #007700">, </span><span style="color: #DD0000">"redirect_query_params"</span><span style="color: #007700">), array(</span><span style="color: #DD0000">"success"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message"</span><span style="color: #007700">, </span><span style="color: #DD0000">"redirect_query_params"</span><span style="color: #007700">)), </span><span style="color: #0000BB">EXTR_OVERWRITE</span><span style="color: #007700">);<br />
<br />
    </span><span style="color: #FF8000">// send any emails<br />
    </span><span style="color: #0000BB">ft_send_emails</span><span style="color: #007700">(</span><span style="color: #DD0000">"on_submission"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;submission_id</span><span style="color: #007700">);<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// if the redirect URL has been specified either in the database or as part of the form<br />
  // submission, redirect the user [form submission form_tools_redirect_url value overrides<br />
  // database value]<br />
  </span><span style="color: #007700">if (!empty(</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"redirect_url"</span><span style="color: #007700">]) || !empty(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #FF8000">// build redirect query string<br />
    </span><span style="color: #0000BB">&#36;redirect_url </span><span style="color: #007700">= (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">]) &amp;&amp; !empty(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">]))<br />
      ? </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">] : </span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"redirect_url"</span><span style="color: #007700">];<br />
<br />
    </span><span style="color: #0000BB">&#36;query_str </span><span style="color: #007700">= </span><span style="color: #DD0000">""</span><span style="color: #007700">;<br />
    if (!empty(</span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">))<br />
      </span><span style="color: #0000BB">&#36;query_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">"&amp;"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">);<br />
<br />
    if (!empty(</span><span style="color: #0000BB">&#36;query_str</span><span style="color: #007700">))<br />
    {<br />
      </span><span style="color: #FF8000">// only include the ? if it's not already there<br />
      </span><span style="color: #007700">if (</span><span style="color: #0000BB">strpos</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;redirect_url</span><span style="color: #007700">, </span><span style="color: #DD0000">"?"</span><span style="color: #007700">))<br />
        </span><span style="color: #0000BB">&#36;redirect_url </span><span style="color: #007700">.= </span><span style="color: #DD0000">"&amp;" </span><span style="color: #007700">. </span><span style="color: #0000BB">&#36;query_str</span><span style="color: #007700">;<br />
      else<br />
        </span><span style="color: #0000BB">&#36;redirect_url </span><span style="color: #007700">.= </span><span style="color: #DD0000">"?" </span><span style="color: #007700">. </span><span style="color: #0000BB">&#36;query_str</span><span style="color: #007700">;<br />
    }<br />
<br />
    </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Location: " </span><span style="color: #007700">. </span><span style="color: #0000BB">&#36;redirect_url</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// the user should never get here! This means that the no redirect URL has been specified<br />
  </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_redirect_url"</span><span style="color: #007700">]);<br />
  </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
  exit;<br />
} <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Here is what I believe is the pertinent part of the HTML:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&lt;form action="http://californiaschooloflaw.com/forms/form_tools_2/process.php" method="post" enctype="multipart/form-data"&gt;<br />
&lt;input type="hidden" name="form_tools_form_id" value="9" /&gt;</code></div></div>]]></description>
			<content:encoded><![CDATA[I hope I am close to getting this form working.  When the user clicks submit we go to a blank Process.php page, however the results are correctly sent to Form Tools.  I dohave a redirect specified in Form Tools for this form, but it doesnt go past process.php.<br />
<br />
I am new to CMSMS and Formtools so thanks in advance for any help in resolving this problem.<br />
<br />
Here is my process.php:<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">PHP Code:</div><div class="body"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php<br />
<br />
</span><span style="color: #FF8000">/**<br />
 * File: process.php<br />
 *<br />
 * This file processes any form submissions for forms already added and configured within Form Tools. To<br />
 * use it, just point your form to this file, like so:<br />
 *<br />
 *   &lt;form method="post" action="/path/to/process.php"&gt;<br />
 *<br />
 * Once the form has been added through the Form Tools UI, this script parses the form contents<br />
 * and adds it to the database then redirects the user to whatever page is required. In addition,<br />
 * this script is used to initially set up the form within the database, to map input fields to<br />
 * database columns and types.<br />
 */<br />
<br />
<br />
// always include the core library functions<br />
</span><span style="color: #0000BB">&#36;folder </span><span style="color: #007700">= </span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />
require_once(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;folder</span><span style="color: #DD0000">/global/library.php"</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// if the API is supplied, include it as well<br />
</span><span style="color: #0000BB">&#36;folder </span><span style="color: #007700">= </span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />
@include_once(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;folder</span><span style="color: #DD0000">/global/api/api.php"</span><span style="color: #007700">);<br />
<br />
<br />
</span><span style="color: #FF8000">// check we're receiving something<br />
</span><span style="color: #007700">if (empty(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">))<br />
{<br />
  </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_post_vars"</span><span style="color: #007700">]);<br />
  </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
  exit;<br />
}<br />
<br />
</span><span style="color: #FF8000">// check there's a form ID included<br />
</span><span style="color: #007700">else if (empty(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_id"</span><span style="color: #007700">]))<br />
{<br />
  </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_form_id"</span><span style="color: #007700">]);<br />
  </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
  exit;<br />
}<br />
<br />
</span><span style="color: #FF8000">// is this an initialization submission?<br />
</span><span style="color: #007700">else if (isset(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_initialize_form"</span><span style="color: #007700">]))<br />
  </span><span style="color: #0000BB">ft_initialize_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// otherwise, it's a regular form submission. Process it!<br />
</span><span style="color: #007700">else<br />
  </span><span style="color: #0000BB">ft_process_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;_POST</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// -------------------------------------------------------------------------------------------------<br />
<br />
/**<br />
 * This function processes the form submissions, after the form has been set up in the database.<br />
 */<br />
</span><span style="color: #007700">function </span><span style="color: #0000BB">ft_process_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">)<br />
{<br />
  global </span><span style="color: #0000BB">&#36;g_table_prefix</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_multi_val_delimiter</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_query_str_multi_val_separator</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_root_dir</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">,<br />
    </span><span style="color: #0000BB">&#36;g_api_version</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;g_api_recaptcha_private_key</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #FF8000">// ensure the incoming values are escaped<br />
  </span><span style="color: #0000BB">&#36;form_data </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_sanitize</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">);<br />
<br />
  </span><span style="color: #0000BB">&#36;form_id </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_id"</span><span style="color: #007700">];<br />
  </span><span style="color: #0000BB">&#36;form_info </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_form</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">);<br />
<br />
  </span><span style="color: #FF8000">// do we have a form for this id?<br />
  </span><span style="color: #007700">if (!</span><span style="color: #0000BB">ft_check_form_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_invalid_form_id"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #0000BB">extract</span><span style="color: #007700">(</span><span style="color: #0000BB">ft_process_hook_calls</span><span style="color: #007700">(</span><span style="color: #DD0000">"start"</span><span style="color: #007700">, </span><span style="color: #0000BB">compact</span><span style="color: #007700">(</span><span style="color: #DD0000">"form_info"</span><span style="color: #007700">, </span><span style="color: #DD0000">"form_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"form_data"</span><span style="color: #007700">), array(</span><span style="color: #DD0000">"form_data"</span><span style="color: #007700">)), </span><span style="color: #0000BB">EXTR_OVERWRITE</span><span style="color: #007700">);<br />
<br />
  </span><span style="color: #FF8000">// check to see if this form has been completely set up<br />
  </span><span style="color: #007700">if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_complete"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no"</span><span style="color: #007700">)<br />
  {<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_form_incomplete"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// check to see if this form has been disabled<br />
  </span><span style="color: #007700">if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_active"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no"</span><span style="color: #007700">)<br />
  {<br />
    if (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_inactive_form_redirect_url"</span><span style="color: #007700">]))<br />
    {<br />
      </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location: </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_inactive_form_redirect_url"</span><span style="color: #007700">]}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br />
      exit;<br />
    }<br />
<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_form_disabled"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// do we have a form for this id?<br />
  </span><span style="color: #007700">if (!</span><span style="color: #0000BB">ft_check_form_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_invalid_form_id"</span><span style="color: #007700">]);<br />
    </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
<br />
  </span><span style="color: #FF8000">// was there a reCAPTCHA response? If so, a recaptcha was just submitted. This generally implies the<br />
  // form page included the API, so check it was entered correctly. If not, return the user to the webpage<br />
  </span><span style="color: #007700">if (isset(</span><span style="color: #0000BB">&#36;g_api_version</span><span style="color: #007700">) &amp;&amp; isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"recaptcha_response_field"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;passes_captcha </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />
    </span><span style="color: #0000BB">&#36;recaptcha_challenge_field </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"recaptcha_challenge_field"</span><span style="color: #007700">];<br />
    </span><span style="color: #0000BB">&#36;recaptcha_response_field  </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"recaptcha_response_field"</span><span style="color: #007700">];<br />
<br />
    </span><span style="color: #0000BB">&#36;folder </span><span style="color: #007700">= </span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br />
    require_once(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;folder</span><span style="color: #DD0000">/global/api/recaptchalib.php"</span><span style="color: #007700">);<br />
<br />
    </span><span style="color: #0000BB">&#36;resp </span><span style="color: #007700">= </span><span style="color: #0000BB">recaptcha_check_answer</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;g_api_recaptcha_private_key</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"REMOTE_ADDR"</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;recaptcha_challenge_field</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;recaptcha_response_field</span><span style="color: #007700">);<br />
<br />
    if (</span><span style="color: #0000BB">&#36;resp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">is_valid</span><span style="color: #007700">)<br />
      </span><span style="color: #0000BB">&#36;passes_captcha </span><span style="color: #007700">= </span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />
    else<br />
    {<br />
      </span><span style="color: #FF8000">// since we need to pass all the info back to the form page we do it by storing the data in sessions. Enable 'em.<br />
      </span><span style="color: #007700">@</span><span style="color: #0000BB">ft_api_start_sessions</span><span style="color: #007700">();<br />
      </span><span style="color: #0000BB">&#36;_SESSION</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_data"</span><span style="color: #007700">] = </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">;<br />
      </span><span style="color: #0000BB">&#36;_SESSION</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_data"</span><span style="color: #007700">][</span><span style="color: #DD0000">"api_recaptcha_error"</span><span style="color: #007700">] = </span><span style="color: #0000BB">&#36;resp</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">error</span><span style="color: #007700">;<br />
<br />
      </span><span style="color: #FF8000">// if there's a form_tools_form_url specified, redirect to that<br />
      </span><span style="color: #007700">if (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_url"</span><span style="color: #007700">]))<br />
      {<br />
        </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location: </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_form_url"</span><span style="color: #007700">]}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br />
        exit;<br />
      }<br />
      </span><span style="color: #FF8000">// if not, see if the server has the redirect URL specified<br />
      </span><span style="color: #007700">else if (isset(</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"HTTP_REFERER"</span><span style="color: #007700">]))<br />
      {<br />
        </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"location: </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"HTTP_REFERER"</span><span style="color: #007700">]}</span><span style="color: #DD0000">"</span><span style="color: #007700">);<br />
        exit;<br />
      }<br />
      </span><span style="color: #FF8000">// no luck! Throw an error<br />
      </span><span style="color: #007700">else<br />
      {<br />
        </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_form_url_for_recaptcha"</span><span style="color: #007700">]);<br />
        </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
        exit;<br />
      }<br />
    }<br />
  }<br />
<br />
<br />
  </span><span style="color: #FF8000">// get a list of the custom form fields (i.e. non-system) for this form<br />
  </span><span style="color: #0000BB">&#36;form_fields </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_form_fields</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">, array(</span><span style="color: #DD0000">"include_field_type_info" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">true</span><span style="color: #007700">));<br />
<br />
  </span><span style="color: #0000BB">&#36;custom_form_fields </span><span style="color: #007700">= array();<br />
  </span><span style="color: #0000BB">&#36;file_fields </span><span style="color: #007700">= array();<br />
  foreach (</span><span style="color: #0000BB">&#36;form_fields </span><span style="color: #007700">as </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">)<br />
  {<br />
    </span><span style="color: #0000BB">&#36;field_id        </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_id"</span><span style="color: #007700">];<br />
    </span><span style="color: #0000BB">&#36;is_system_field </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_system_field"</span><span style="color: #007700">];<br />
    </span><span style="color: #0000BB">&#36;field_name      </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_name"</span><span style="color: #007700">];<br />
<br />
    </span><span style="color: #FF8000">// ignore system fields<br />
    </span><span style="color: #007700">if (</span><span style="color: #0000BB">&#36;is_system_field </span><span style="color: #007700">== </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
      continue;<br />
<br />
    if (</span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_file_field"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no"</span><span style="color: #007700">)<br />
    {<br />
      </span><span style="color: #0000BB">&#36;custom_form_fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">] = array(<br />
        </span><span style="color: #DD0000">"field_id"    </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_id</span><span style="color: #007700">,<br />
        </span><span style="color: #DD0000">"col_name"    </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"col_name"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"field_title" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_title"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"include_on_redirect" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"include_on_redirect"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"field_type_id" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_type_id"</span><span style="color: #007700">],<br />
        </span><span style="color: #DD0000">"is_date_field" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_date_field"</span><span style="color: #007700">]<br />
      );<br />
    }<br />
    else<br />
    {<br />
      </span><span style="color: #0000BB">&#36;file_fields</span><span style="color: #007700">[] = array(<br />
        </span><span style="color: #DD0000">"field_id"   </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_id</span><span style="color: #007700">,<br />
        </span><span style="color: #DD0000">"field_info" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;field_info<br />
      </span><span style="color: #007700">);<br />
    }<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// now examine the contents of the POST/GET submission and get a list of those fields<br />
  // which we're going to update<br />
  </span><span style="color: #0000BB">&#36;valid_form_fields </span><span style="color: #007700">= array();<br />
  while (list(</span><span style="color: #0000BB">&#36;form_field</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">) = </span><span style="color: #0000BB">each</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">))<br />
  {<br />
    </span><span style="color: #FF8000">// if this field is included, store the value for adding to DB<br />
    </span><span style="color: #007700">if (</span><span style="color: #0000BB">array_key_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_field</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;custom_form_fields</span><span style="color: #007700">))<br />
    {<br />
      </span><span style="color: #0000BB">&#36;curr_form_field </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;custom_form_fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;form_field</span><span style="color: #007700">];<br />
<br />
      </span><span style="color: #0000BB">&#36;cleaned_value </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">;<br />
      if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">))<br />
      {<br />
        if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"submission_strip_tags"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
        {<br />
          for (</span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">; </span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">); </span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">++)<br />
            </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">] = </span><span style="color: #0000BB">strip_tags</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;i</span><span style="color: #007700">]);<br />
        }<br />
<br />
        </span><span style="color: #0000BB">&#36;cleaned_value </span><span style="color: #007700">= </span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;g_multi_val_delimiter</span><span style="color: #DD0000">"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">);<br />
      }<br />
      else<br />
      {<br />
        if (</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"submission_strip_tags"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
          </span><span style="color: #0000BB">&#36;cleaned_value </span><span style="color: #007700">= </span><span style="color: #0000BB">strip_tags</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value</span><span style="color: #007700">);<br />
      }<br />
<br />
      </span><span style="color: #0000BB">&#36;valid_form_fields</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;curr_form_field</span><span style="color: #007700">[</span><span style="color: #DD0000">"col_name"</span><span style="color: #007700">]] = </span><span style="color: #DD0000">"'</span><span style="color: #0000BB">&#36;cleaned_value</span><span style="color: #DD0000">'"</span><span style="color: #007700">;<br />
    }<br />
  }<br />
<br />
  </span><span style="color: #0000BB">&#36;now </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_current_datetime</span><span style="color: #007700">();<br />
  </span><span style="color: #0000BB">&#36;ip_address </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">"REMOTE_ADDR"</span><span style="color: #007700">];<br />
<br />
  </span><span style="color: #0000BB">&#36;col_names </span><span style="color: #007700">= </span><span style="color: #0000BB">array_keys</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;valid_form_fields</span><span style="color: #007700">);<br />
  </span><span style="color: #0000BB">&#36;col_names_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">", "</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;col_names</span><span style="color: #007700">);<br />
  if (!empty(</span><span style="color: #0000BB">&#36;col_names_str</span><span style="color: #007700">))<br />
    </span><span style="color: #0000BB">&#36;col_names_str </span><span style="color: #007700">.= </span><span style="color: #DD0000">", "</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #0000BB">&#36;col_values </span><span style="color: #007700">= </span><span style="color: #0000BB">array_values</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;valid_form_fields</span><span style="color: #007700">);<br />
  </span><span style="color: #0000BB">&#36;col_values_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">", "</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;col_values</span><span style="color: #007700">);<br />
  if (!empty(</span><span style="color: #0000BB">&#36;col_values_str</span><span style="color: #007700">))<br />
    </span><span style="color: #0000BB">&#36;col_values_str </span><span style="color: #007700">.= </span><span style="color: #DD0000">", "</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #FF8000">// build our query<br />
  </span><span style="color: #0000BB">&#36;query </span><span style="color: #007700">= </span><span style="color: #DD0000">"<br />
    INSERT INTO </span><span style="color: #007700">{</span><span style="color: #0000BB">&#36;g_table_prefix</span><span style="color: #007700">}</span><span style="color: #DD0000">form_</span><span style="color: #0000BB">&#36;form_id</span><span style="color: #DD0000"> (</span><span style="color: #0000BB">&#36;col_names_str</span><span style="color: #DD0000"> submission_date, last_modified_date, ip_address, is_finalized)<br />
    VALUES (</span><span style="color: #0000BB">&#36;col_values_str</span><span style="color: #DD0000"> '</span><span style="color: #0000BB">&#36;now</span><span style="color: #DD0000">', '</span><span style="color: #0000BB">&#36;now</span><span style="color: #DD0000">', '</span><span style="color: #0000BB">&#36;ip_address</span><span style="color: #DD0000">', 'yes')<br />
           "</span><span style="color: #007700">;<br />
<br />
  </span><span style="color: #FF8000">// add the submission to the database (if form_tools_ignore_submission key isn't set by either the form or a module)<br />
  </span><span style="color: #0000BB">&#36;submission_id </span><span style="color: #007700">= </span><span style="color: #DD0000">""</span><span style="color: #007700">;<br />
  if (!isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_ignore_submission"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #0000BB">&#36;result </span><span style="color: #007700">= </span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;query</span><span style="color: #007700">);<br />
<br />
    if (!</span><span style="color: #0000BB">&#36;result</span><span style="color: #007700">)<br />
    {<br />
      </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"error_code" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">304</span><span style="color: #007700">, </span><span style="color: #DD0000">"error_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"system"</span><span style="color: #007700">,<br />
        </span><span style="color: #DD0000">"debugging"</span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"Failed query in &lt;b&gt;" </span><span style="color: #007700">. </span><span style="color: #0000BB">__FUNCTION__ </span><span style="color: #007700">. </span><span style="color: #DD0000">", " </span><span style="color: #007700">. </span><span style="color: #0000BB">__FILE__ </span><span style="color: #007700">. </span><span style="color: #DD0000">"&lt;/b&gt;, line " </span><span style="color: #007700">. </span><span style="color: #0000BB">__LINE__ </span><span style="color: #007700">.<br />
            </span><span style="color: #DD0000">": &lt;i&gt;" </span><span style="color: #007700">. </span><span style="color: #0000BB">nl2br</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;query</span><span style="color: #007700">) . </span><span style="color: #DD0000">"&lt;/i&gt;"</span><span style="color: #007700">, </span><span style="color: #0000BB">mysql_error</span><span style="color: #007700">());<br />
      </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
      exit;<br />
    }<br />
<br />
    </span><span style="color: #0000BB">&#36;submission_id </span><span style="color: #007700">= </span><span style="color: #0000BB">mysql_insert_id</span><span style="color: #007700">();<br />
    </span><span style="color: #0000BB">extract</span><span style="color: #007700">(</span><span style="color: #0000BB">ft_process_hook_calls</span><span style="color: #007700">(</span><span style="color: #DD0000">"end"</span><span style="color: #007700">, </span><span style="color: #0000BB">compact</span><span style="color: #007700">(</span><span style="color: #DD0000">"form_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"submission_id"</span><span style="color: #007700">), array()), </span><span style="color: #0000BB">EXTR_OVERWRITE</span><span style="color: #007700">);<br />
  }<br />
<br />
<br />
  </span><span style="color: #0000BB">&#36;redirect_query_params </span><span style="color: #007700">= array();<br />
<br />
  </span><span style="color: #FF8000">// build the redirect query parameter array<br />
  </span><span style="color: #007700">foreach (</span><span style="color: #0000BB">&#36;form_fields </span><span style="color: #007700">as </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">)<br />
  {<br />
    if (</span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"include_on_redirect"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"no" </span><span style="color: #007700">|| </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"is_file_field"</span><span style="color: #007700">] == </span><span style="color: #DD0000">"yes"</span><span style="color: #007700">)<br />
      continue;<br />
<br />
    switch (</span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"col_name"</span><span style="color: #007700">])<br />
    {<br />
      case </span><span style="color: #DD0000">"submission_id"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"submission_id=</span><span style="color: #0000BB">&#36;submission_id</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />
        break;<br />
      case </span><span style="color: #DD0000">"submission_date"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;settings </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_settings</span><span style="color: #007700">();<br />
        </span><span style="color: #0000BB">&#36;submission_date_formatted </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_date</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_timezone_offset"</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;now</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_date_format"</span><span style="color: #007700">]);<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"submission_date=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;submission_date_formatted</span><span style="color: #007700">);<br />
        break;<br />
      case </span><span style="color: #DD0000">"last_modified_date"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;settings </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_settings</span><span style="color: #007700">();<br />
        </span><span style="color: #0000BB">&#36;submission_date_formatted </span><span style="color: #007700">= </span><span style="color: #0000BB">ft_get_date</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_timezone_offset"</span><span style="color: #007700">], </span><span style="color: #0000BB">&#36;now</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;settings</span><span style="color: #007700">[</span><span style="color: #DD0000">"default_date_format"</span><span style="color: #007700">]);<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"last_modified_date=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;submission_date_formatted</span><span style="color: #007700">);<br />
        break;<br />
      case </span><span style="color: #DD0000">"ip_address"</span><span style="color: #007700">:<br />
        </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"ip_address=</span><span style="color: #0000BB">&#36;ip_address</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />
        break;<br />
<br />
      default:<br />
        </span><span style="color: #0000BB">&#36;field_name </span><span style="color: #007700">= </span><span style="color: #0000BB">&#36;field_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"field_name"</span><span style="color: #007700">];<br />
<br />
        </span><span style="color: #FF8000">// if &#36;value is an array, convert it to a string, separated by &#36;g_query_str_multi_val_separator<br />
        </span><span style="color: #007700">if (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]))<br />
        {<br />
          if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]))<br />
          {<br />
            </span><span style="color: #0000BB">&#36;value_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;g_query_str_multi_val_separator</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]);<br />
            </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #DD0000">=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;value_str</span><span style="color: #007700">);<br />
          }<br />
          else<br />
            </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">[] = </span><span style="color: #DD0000">"</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #DD0000">=" </span><span style="color: #007700">. </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #0000BB">&#36;field_name</span><span style="color: #007700">]);<br />
        }<br />
        break;<br />
    }<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// only upload files &amp; send emails if we're not ignoring the submission<br />
  </span><span style="color: #007700">if (!isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_ignore_submission"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #FF8000">// now process any file fields. This is placed after the redirect query param code block above to allow whatever file upload<br />
    // module to append the filename to the query string, if needed<br />
    </span><span style="color: #0000BB">extract</span><span style="color: #007700">(</span><span style="color: #0000BB">ft_process_hook_calls</span><span style="color: #007700">(</span><span style="color: #DD0000">"manage_files"</span><span style="color: #007700">, </span><span style="color: #0000BB">compact</span><span style="color: #007700">(</span><span style="color: #DD0000">"form_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"submission_id"</span><span style="color: #007700">, </span><span style="color: #DD0000">"file_fields"</span><span style="color: #007700">, </span><span style="color: #DD0000">"redirect_query_params"</span><span style="color: #007700">), array(</span><span style="color: #DD0000">"success"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message"</span><span style="color: #007700">, </span><span style="color: #DD0000">"redirect_query_params"</span><span style="color: #007700">)), </span><span style="color: #0000BB">EXTR_OVERWRITE</span><span style="color: #007700">);<br />
<br />
    </span><span style="color: #FF8000">// send any emails<br />
    </span><span style="color: #0000BB">ft_send_emails</span><span style="color: #007700">(</span><span style="color: #DD0000">"on_submission"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;form_id</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;submission_id</span><span style="color: #007700">);<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// if the redirect URL has been specified either in the database or as part of the form<br />
  // submission, redirect the user [form submission form_tools_redirect_url value overrides<br />
  // database value]<br />
  </span><span style="color: #007700">if (!empty(</span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"redirect_url"</span><span style="color: #007700">]) || !empty(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">]))<br />
  {<br />
    </span><span style="color: #FF8000">// build redirect query string<br />
    </span><span style="color: #0000BB">&#36;redirect_url </span><span style="color: #007700">= (isset(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">]) &amp;&amp; !empty(</span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">]))<br />
      ? </span><span style="color: #0000BB">&#36;form_data</span><span style="color: #007700">[</span><span style="color: #DD0000">"form_tools_redirect_url"</span><span style="color: #007700">] : </span><span style="color: #0000BB">&#36;form_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"redirect_url"</span><span style="color: #007700">];<br />
<br />
    </span><span style="color: #0000BB">&#36;query_str </span><span style="color: #007700">= </span><span style="color: #DD0000">""</span><span style="color: #007700">;<br />
    if (!empty(</span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">))<br />
      </span><span style="color: #0000BB">&#36;query_str </span><span style="color: #007700">= </span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #DD0000">"&amp;"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;redirect_query_params</span><span style="color: #007700">);<br />
<br />
    if (!empty(</span><span style="color: #0000BB">&#36;query_str</span><span style="color: #007700">))<br />
    {<br />
      </span><span style="color: #FF8000">// only include the ? if it's not already there<br />
      </span><span style="color: #007700">if (</span><span style="color: #0000BB">strpos</span><span style="color: #007700">(</span><span style="color: #0000BB">&#36;redirect_url</span><span style="color: #007700">, </span><span style="color: #DD0000">"?"</span><span style="color: #007700">))<br />
        </span><span style="color: #0000BB">&#36;redirect_url </span><span style="color: #007700">.= </span><span style="color: #DD0000">"&amp;" </span><span style="color: #007700">. </span><span style="color: #0000BB">&#36;query_str</span><span style="color: #007700">;<br />
      else<br />
        </span><span style="color: #0000BB">&#36;redirect_url </span><span style="color: #007700">.= </span><span style="color: #DD0000">"?" </span><span style="color: #007700">. </span><span style="color: #0000BB">&#36;query_str</span><span style="color: #007700">;<br />
    }<br />
<br />
    </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Location: " </span><span style="color: #007700">. </span><span style="color: #0000BB">&#36;redirect_url</span><span style="color: #007700">);<br />
    exit;<br />
  }<br />
<br />
  </span><span style="color: #FF8000">// the user should never get here! This means that the no redirect URL has been specified<br />
  </span><span style="color: #0000BB">&#36;page_vars </span><span style="color: #007700">= array(</span><span style="color: #DD0000">"message_type" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"error"</span><span style="color: #007700">, </span><span style="color: #DD0000">"message" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">&#36;LANG</span><span style="color: #007700">[</span><span style="color: #DD0000">"processing_no_redirect_url"</span><span style="color: #007700">]);<br />
  </span><span style="color: #0000BB">ft_display_page</span><span style="color: #007700">(</span><span style="color: #DD0000">"error.tpl"</span><span style="color: #007700">, </span><span style="color: #0000BB">&#36;page_vars</span><span style="color: #007700">);<br />
  exit;<br />
} <br />
</span><span style="color: #0000BB"></code></div></pre></div></div><br />
Here is what I believe is the pertinent part of the HTML:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&lt;form action="http://californiaschooloflaw.com/forms/form_tools_2/process.php" method="post" enctype="multipart/form-data"&gt;<br />
&lt;input type="hidden" name="form_tools_form_id" value="9" /&gt;</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Edit submission Submission Accounts]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=2818</link>
			<pubDate>Mon, 20 Jan 2014 15:36:04 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=2818</guid>
			<description><![CDATA[I am using custom js "function" validations for the forms I'm creating and re-directing the web page if javascript is not enabled on individual user browsers.<br />
Using submission accounts I can have individual forms modified by the user, but I can't activate the custom js functions I need from the original form. Am I missing something?<br />
If I can not use the custom functions in edit submissions/submission accounts, is there any way to open the original form with a link in the submission email that includes ...php?submission_id=17 so the original form comes up populated with the submission data and these custom functions are activated?<br />
]]></description>
			<content:encoded><![CDATA[I am using custom js "function" validations for the forms I'm creating and re-directing the web page if javascript is not enabled on individual user browsers.<br />
Using submission accounts I can have individual forms modified by the user, but I can't activate the custom js functions I need from the original form. Am I missing something?<br />
If I can not use the custom functions in edit submissions/submission accounts, is there any way to open the original form with a link in the submission email that includes ...php?submission_id=17 so the original form comes up populated with the submission data and these custom functions are activated?<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[in rsv.js form name]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=2797</link>
			<pubDate>Tue, 31 Dec 2013 18:02:44 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=2797</guid>
			<description><![CDATA[Ok, this should be a really simple one for someone.<br />
using rules.push("function,dobValidation")<br />
<br />
in the rev.js I have to specify the field to look at.<br />
The javascript works when I use a static date using a string. When I try to grab the field it fails. I believe it's due to using the wrong fromname.<br />
so.. that being said: form name in rsv.js would be...<br />
the table name in mysql? - ie: re_form_1<br />
the form name described in the form view? ie: delivery form<br />
Name of the published form file: ie: bndelivery.php?<br />
I'm assuming it's not the form ID: ie: 1<br />
<br />
Maybe that's not the problem. I know it all works with the static date and I can't get the error info go to group in with the others (I believe for the same reason)<br />
<br />
see // comments in code below.<br />
Thanks ahead of time!!!! Drivin me nuts.<br />
and Happy New Year!<br />
<br />
<br />
<br />
function dobValidation() {<br />
 //below commented line does not work. form name suspect<br />
//var fielddateValue = document.re_form_1.Date_Of_Birth.value;<br />
<br />
//works fine with a static date!<br />
 var fielddateValue = ('11/1/1999');<br />
 alert (fielddateValue);<br />
 var fielddate = fielddateValue.split('/');<br />
<br />
  var fieldmonth = (-fielddate[0]);<br />
  var fielddays1 = (fielddate[1]);<br />
  var fieldyears1 = (fielddate[2]);<br />
  <br />
 var fieldjsdate = new Date(fielddate[2], --fielddate[0], fielddate[1]);<br />
   <br />
  //current date information<br />
  var currentDate = new Date();<br />
  var theday = currentDate.getDate();<br />
  var themonth = currentDate.getMonth();<br />
  var theyear = currentDate.getFullYear();<br />
<br />
  var s = new Date(+fieldjsdate);<br />
  alert (fieldjsdate + ' = js date');<br />
  var e = new Date(theyear,themonth,theday);<br />
  var timeDiff, timeDiff2, days2, years, months, days, hours, minutes, seconds;<br />
  <br />
  years = e.getFullYear() - s.getFullYear();<br />
  timeDiff2 = (e - s);<br />
  days2 = (timeDiff2/(24*60*60*1000));  <br />
  <br />
//Can't get the error info to come over properly since I can't get the filed valiue.<br />
 var errorinfo = ['We are not accepting applications for individuals under 18'];  <br />
 <br />
  if (days2 &lt; 6570) {<br />
<br />
//I know it should return an array, but it fails due to not retrieving the field value. Meanwhile I'm just returning one letter - I'm surprised it's returning anything as it is.<br />
//The alert alone works for now, but then it's not grouped with the others as it should be.<br />
<br />
 alert ('We are not accepting applications for individuals under 18'); return (errorinfo);<br />
    }<br />
  else<br />
    {<br />
    return true;<br />
  }<br />
}<br />
]]></description>
			<content:encoded><![CDATA[Ok, this should be a really simple one for someone.<br />
using rules.push("function,dobValidation")<br />
<br />
in the rev.js I have to specify the field to look at.<br />
The javascript works when I use a static date using a string. When I try to grab the field it fails. I believe it's due to using the wrong fromname.<br />
so.. that being said: form name in rsv.js would be...<br />
the table name in mysql? - ie: re_form_1<br />
the form name described in the form view? ie: delivery form<br />
Name of the published form file: ie: bndelivery.php?<br />
I'm assuming it's not the form ID: ie: 1<br />
<br />
Maybe that's not the problem. I know it all works with the static date and I can't get the error info go to group in with the others (I believe for the same reason)<br />
<br />
see // comments in code below.<br />
Thanks ahead of time!!!! Drivin me nuts.<br />
and Happy New Year!<br />
<br />
<br />
<br />
function dobValidation() {<br />
 //below commented line does not work. form name suspect<br />
//var fielddateValue = document.re_form_1.Date_Of_Birth.value;<br />
<br />
//works fine with a static date!<br />
 var fielddateValue = ('11/1/1999');<br />
 alert (fielddateValue);<br />
 var fielddate = fielddateValue.split('/');<br />
<br />
  var fieldmonth = (-fielddate[0]);<br />
  var fielddays1 = (fielddate[1]);<br />
  var fieldyears1 = (fielddate[2]);<br />
  <br />
 var fieldjsdate = new Date(fielddate[2], --fielddate[0], fielddate[1]);<br />
   <br />
  //current date information<br />
  var currentDate = new Date();<br />
  var theday = currentDate.getDate();<br />
  var themonth = currentDate.getMonth();<br />
  var theyear = currentDate.getFullYear();<br />
<br />
  var s = new Date(+fieldjsdate);<br />
  alert (fieldjsdate + ' = js date');<br />
  var e = new Date(theyear,themonth,theday);<br />
  var timeDiff, timeDiff2, days2, years, months, days, hours, minutes, seconds;<br />
  <br />
  years = e.getFullYear() - s.getFullYear();<br />
  timeDiff2 = (e - s);<br />
  days2 = (timeDiff2/(24*60*60*1000));  <br />
  <br />
//Can't get the error info to come over properly since I can't get the filed valiue.<br />
 var errorinfo = ['We are not accepting applications for individuals under 18'];  <br />
 <br />
  if (days2 &lt; 6570) {<br />
<br />
//I know it should return an array, but it fails due to not retrieving the field value. Meanwhile I'm just returning one letter - I'm surprised it's returning anything as it is.<br />
//The alert alone works for now, but then it's not grouped with the others as it should be.<br />
<br />
 alert ('We are not accepting applications for individuals under 18'); return (errorinfo);<br />
    }<br />
  else<br />
    {<br />
    return true;<br />
  }<br />
}<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Client account edit, add and validation]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=2737</link>
			<pubDate>Thu, 21 Nov 2013 19:34:54 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=2737</guid>
			<description><![CDATA[Just a quick confirmation.<br />
When a client is logged in, adds submissions and updates existing submissions, the page template sets no longer apply for validations.<br />
Therefore, the server-side validation has to be modified yes?<br />
<br />
Where can I add -what files where<br />
rules.push("if:...")  and rules.push("function,whatever")<br />
for client account updating and adding submissions from the client log edit and add as opposed to using the actual form to fill out the information?<br />
]]></description>
			<content:encoded><![CDATA[Just a quick confirmation.<br />
When a client is logged in, adds submissions and updates existing submissions, the page template sets no longer apply for validations.<br />
Therefore, the server-side validation has to be modified yes?<br />
<br />
Where can I add -what files where<br />
rules.push("if:...")  and rules.push("function,whatever")<br />
for client account updating and adding submissions from the client log edit and add as opposed to using the actual form to fill out the information?<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[\D,]+ digits and comma only validation]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=2735</link>
			<pubDate>Wed, 20 Nov 2013 17:07:42 -0800</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=2735</guid>
			<description><![CDATA[I added a case to the rsv.js but I'm just not getting the regexp right.<br />
The field needs to have just numbers and commas.<br />
These numbers can range from 1-900.<br />
<br />
       case "digitscommas_only":<br />
        if (form[fieldName].value &amp;&amp; form[fieldName].value.match(/[\D,]+/))<br />
        {<br />
          if (!rsv.processError(form[fieldName], errorMessage))<br />
            return false;<br />
        }<br />
        break;<br />
<br />
I thought I'd keep it simple with just Digits and comma range, but I'm missing something.<br />
<br />
value.match(/[\D,]+/)) is allowing only digits, put a comma in the field and it fails. I tried the unicode variation as well [\D\U+002C]+<br />
I also tried (/[\D\%%C%%]+/)) since the commas are replaced with %%C%% earlier on in the rsv.js, but I believe they are back by this point in the validation function.<br />
<br />
[\D,]+ seemed pretty obvious. what am I missing?<br />
<br />
<br />
]]></description>
			<content:encoded><![CDATA[I added a case to the rsv.js but I'm just not getting the regexp right.<br />
The field needs to have just numbers and commas.<br />
These numbers can range from 1-900.<br />
<br />
       case "digitscommas_only":<br />
        if (form[fieldName].value &amp;&amp; form[fieldName].value.match(/[\D,]+/))<br />
        {<br />
          if (!rsv.processError(form[fieldName], errorMessage))<br />
            return false;<br />
        }<br />
        break;<br />
<br />
I thought I'd keep it simple with just Digits and comma range, but I'm missing something.<br />
<br />
value.match(/[\D,]+/)) is allowing only digits, put a comma in the field and it fails. I tried the unicode variation as well [\D\U+002C]+<br />
I also tried (/[\D\%%C%%]+/)) since the commas are replaced with %%C%% earlier on in the rsv.js, but I believe they are back by this point in the validation function.<br />
<br />
[\D,]+ seemed pretty obvious. what am I missing?<br />
<br />
<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[IP filtering]]></title>
			<link>https://forums.formtools.org/showthread.php?tid=2721</link>
			<pubDate>Mon, 28 Oct 2013 07:37:26 -0700</pubDate>
			<guid isPermaLink="false">https://forums.formtools.org/showthread.php?tid=2721</guid>
			<description><![CDATA[Dear All,<br />
<br />
I've installed FormTools several months ago, and it runs smooth !<br />
Now some stupid person has found a way to spam the contest (where we use the formtool for).<br />
<br />
We filter on unique email, but he keeps entering/spamming the contest with unique emailaddresses from the same domain and within the same IP number.<br />
<br />
I've been looking for it in the tuts and this forum, but have not found the right solution.<br />
<br />
Is there a way to blacklist a certain IP, or perhaps limit form submissions to 1 entry per IP ?<br />
<br />
If you like I can past my PHP code of the form if that helps !<br />
<br />
Thanks for :<br />
1) a great formscript<br />
2) your kind support ]]></description>
			<content:encoded><![CDATA[Dear All,<br />
<br />
I've installed FormTools several months ago, and it runs smooth !<br />
Now some stupid person has found a way to spam the contest (where we use the formtool for).<br />
<br />
We filter on unique email, but he keeps entering/spamming the contest with unique emailaddresses from the same domain and within the same IP number.<br />
<br />
I've been looking for it in the tuts and this forum, but have not found the right solution.<br />
<br />
Is there a way to blacklist a certain IP, or perhaps limit form submissions to 1 entry per IP ?<br />
<br />
If you like I can past my PHP code of the form if that helps !<br />
<br />
Thanks for :<br />
1) a great formscript<br />
2) your kind support ]]></content:encoded>
		</item>
	</channel>
</rss>