<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Custom Redirect URL using value from hidden field</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Custom Redirect URL using value from hidden field</description>
<language>en</language>
<pubDate>Thu, 21 May 2026 21:36:41 +0000</pubDate>

<item>
<title>moonlightss on "Custom Redirect URL using value from hidden field"</title>
<link>https://www.machform.com/forums/topic/custom-redirect-url-using-value-from-hidden-field#post-9537</link>
<pubDate>Sun, 23 May 2010 04:24:57 +0000</pubDate>
<dc:creator>moonlightss</dc:creator>
<guid isPermaLink="false">9537@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi RonPacheco,&#60;/p&#62;
&#60;p&#62;Great tip.  I was looking for something exactly like this.  However, i do have one question.  When i pass an element like this {element_1_1} it fails to do the replacement.  I change '/\{(element_\d+)\}/'  to this  '/\{(element_\d+_d+)\}/' and it works for the {element_1_1} replacement, but not the {element_1} replacement.  Not much on this particular function of matching.  is there any way to catch both?&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
</item>
<item>
<title>RonPacheco on "Custom Redirect URL using value from hidden field"</title>
<link>https://www.machform.com/forums/topic/custom-redirect-url-using-value-from-hidden-field#post-9460</link>
<pubDate>Fri, 14 May 2010 02:46:51 +0000</pubDate>
<dc:creator>RonPacheco</dc:creator>
<guid isPermaLink="false">9460@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I needed to do almost this same exact thing, but I needed a more general and permanent solution. I solved this by adding the ability to have the redirect string include form fields. E.g., my redirect string for the form on the form properties page is specified something like this:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;a href=&#34;http://my.site.com/page.php?x=&#38;quot;&#34; rel=&#34;nofollow&#34;&#62;http://my.site.com/page.php?x=&#38;quot;&#60;/a&#62;{element_1}&#38;quot;&#38;#38;y=&#38;quot;{element_12}&#38;quot;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;When the form is submitted, the proper fields from the form submission are substituted into the URL.&#60;/p&#62;
&#60;p&#62;Here's the code block that accomplishes this. It should be inserted into the &#34;includes/post-function.php&#34; file in the same position as the solution proposed above.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// perform input field substitutions on redirect url
while ( preg_match( &#38;#39;/\{(element_\d+)\}/&#38;#39;, $process_result[&#38;#39;form_redirect&#38;#39;], $matches ) &#38;gt; 0 ) {
  if ( !empty( $table_data[$matches[1]] ) ) {
    $process_result[&#38;#39;form_redirect&#38;#39;] =
      str_replace( $matches[0], urlencode( $table_data[$matches[1]] ), $process_result[&#38;#39;form_redirect&#38;#39;] );
  }
  else {
    $form_redirect = str_replace( $matches[0], &#38;#39;&#38;#39;, $form_redirect );
  }
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Just thought I would share since this is a great little app and I found this small enhancement to be quite powerful!
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Custom Redirect URL using value from hidden field"</title>
<link>https://www.machform.com/forums/topic/custom-redirect-url-using-value-from-hidden-field#post-6751</link>
<pubDate>Wed, 29 Jul 2009 15:26:09 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">6751@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;To do that you need to edit &#34;includes/post-functions.php&#34; file, go to around line 953 ~ 954 and you will see these code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//add session_id to query if &#38;#39;form review&#38;#39; enabled
if(!empty($form_review)){&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;put these code exactly above that line &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if (!empty($table_data[&#38;#39;element_10&#38;#39;])  &#38;#38;&#38;#38; $form_id == &#38;#39;5&#38;#39;) {
	$process_result[&#38;#39;form_redirect&#38;#39;] = $table_data[&#38;#39;element_10&#38;#39;];
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;In there i assume your form id is 5, don't forget to change the ID's with yours. Anyway to hide the field you can add these code in CSS form &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#li_10
{
display:none !important;
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>JugglerX on "Custom Redirect URL using value from hidden field"</title>
<link>https://www.machform.com/forums/topic/custom-redirect-url-using-value-from-hidden-field#post-6747</link>
<pubDate>Wed, 29 Jul 2009 11:39:21 +0000</pubDate>
<dc:creator>JugglerX</dc:creator>
<guid isPermaLink="false">6747@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I am trying to specify the custom redirect URL using the value of a hidden field in my form. the field is {element_10}&#60;/p&#62;
&#60;p&#62;I had a look through the code and tried ['form_redirect'] = '{element_10}' but that did not work. I think you can see what I'm trying to achieve but I don't know the correct code.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
