<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Form fields in custom form</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Form-fields-in-custom-form-79582</link>
        <description></description>
        <pubDate>Tue, 13 Oct 2026 06:35:32 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Form-fields-in-custom-form-79582" rel="self" type="application/rss+xml" />

                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234794#post2234794</link>
          <description><![CDATA[<p>Hi April</p>
<p>Sorry for the late reply, I was out of the office yesterday.</p>
<p>The issue with the days in the email template is the same as previously - you'll need to check if the variable is set in $_REQUEST before you try to implode it.</p>
<p>Adding the image should be fine - are you getting a file name or a data resource?</p>]]></description>
          <pubDate>Thu, 21 Aug 2014 13:41:00 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234794#post2234794</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234788#post2234788</link>
          <description><![CDATA[<p>I have one other question with the email template:</p>
<p>Is there a way to include an image filename in email template?</p>

<p><code>'image'        =&gt; $_REQUEST['image'],</code></p>
<p>EX: So the emailed template could show the following:</p>
<p>Image: <span>177114234-family_003.jpg</span></p>]]></description>
          <pubDate>Thu, 21 Aug 2014 08:59:13 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234788#post2234788</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234783#post2234783</link>
          <description><![CDATA[<p>Sorry, I just realized I was looking at the coding for my preview and it worked perfectly for that. <br /><br />It doesn't work in the email template. Is there an easy way to make the days of week show up in the email template?</p>]]></description>
          <pubDate>Wed, 20 Aug 2014 07:47:44 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234783#post2234783</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234782#post2234782</link>
          <description><![CDATA[<p>Claire,</p>
<p>I used this and it worked perfectly to output text in my email template.</p>
<p>However, then when I went back to submit my form again, I got the following error where this code is located.</p>

<p><code>'days'             =&gt; implode(', ',$_REQUEST['days']),</code></p>

<p><span>Notice: Undefined index: days in C:\inetpub\charlotteparent\directory\forms\form.php on line 293 Warning: implode(): Invalid arguments passed in C:\inetpub\charlotteparent\directory\forms\form.php on line 293</span></p>
<p><span>Is it conflicting with the main code we placed to make days of week work or if there an easy to fix?</span></p>

<p><code>// setup checkbox days<br />  if(isset($_REQUEST['days'])) {<br />    $days_TSV = "\t" . implode("\t", $_REQUEST['days'] ) . "\t";<br /> }<br /> else {<br />     $days_TSV = "";<br /> }</code></p>
]]></description>
          <pubDate>Wed, 20 Aug 2014 07:39:59 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234782#post2234782</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234766#post2234766</link>
          <description><![CDATA[<p>Hi April</p>
<p>The days of the week are in an array, and you can't echo arrays without doing a little preparation first.</p>
<p>Try something like this: </p>
<p><code>implode(', ',$_REQUEST['days'])</code></p>
<p>in order to show the array as a string of characters. What it should do is combine all the array elements into a single string separated by commas.</p>]]></description>
          <pubDate>Fri, 15 Aug 2014 13:58:24 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234766#post2234766</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234765#post2234765</link>
          <description><![CDATA[<p>Claire,</p>
<p>I one other thing I need help with. With the coding above that we used to output the days of week which is a multiple list with checkbox. It works perfect to record the data in backend of CMS. However, when I put the</p>
<p><code>&lt;?= @$_REQUEST['days']?&gt;</code></p>
<p>in my preview file, it just outputs array. It also does the same for the email template (#days#) that is sent to user and admin:</p>
<p><code>'days'            =&gt; $_REQUEST['days'],</code></p>
<p>Is there a way to make that data display properly in the preview file and email template? I have uploaded my file as well in case you need to look at everything.</p>
<p>Here is my coding for the checkbox:</p>
<p><code>&lt;div id="days" &gt;<br />&lt;div class="form-label"&gt;Days of Week:&lt;/div&gt;<br />&lt;div class="form-field"&gt;<br /><br />&lt;fieldset&gt;<br />&lt;?php foreach($days_dirRecords as $record): ?&gt;<br />&lt;input type="checkbox" value="&lt;?php echo $record['habbit']; ?&gt;" &lt;?php echo checkIfInArray($record['habbit'], @$_REQUEST["days"]) ?&gt; name="days[]" /&gt;&amp;nbsp;&lt;?php echo $record['habbit']; ?&gt;<br />&lt;br /&gt;<br />&lt;?php endforeach; ?&gt;<br />&lt;/fieldset&gt;<br /><br /><br /><br />&lt;/div&gt;&lt;/div&gt;</code></p>
<p>Thanks! April</p>]]></description>
          <pubDate>Fri, 15 Aug 2014 13:48:34 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234765#post2234765</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234732#post2234732</link>
          <description><![CDATA[<p>Claire,</p>
<p>I one other thing I need help with. With the coding above that we used to output the days of week which is a multiple list with checkbox. It works perfect to record the data in backend of CMS. However, when I put the</p>
<p><code>&lt;?= @$_REQUEST['days']?&gt;</code></p>
<p>in my preview file, it just outputs array. It also does the same for the email template (#days#) that is sent to user and admin:</p>
<p><code>'days'            =&gt; $_REQUEST['days'],</code></p>
<p>Is there a way to make that data display properly in the preview file and email template? I have uploaded my file as well in case you need to look at everything.</p>
<p>Here is my coding for the checkbox:</p>
<p><code>&lt;div id="days" &gt;<br /> &lt;div class="form-label"&gt;Days of Week:&lt;/div&gt;<br /> &lt;div class="form-field"&gt;<br /><br /> &lt;fieldset&gt;<br /> &lt;?php foreach($days_dirRecords as $record): ?&gt;<br /> &lt;input type="checkbox" value="&lt;?php echo $record['habbit']; ?&gt;" &lt;?php echo checkIfInArray($record['habbit'], @$_REQUEST["days"]) ?&gt; name="days[]" /&gt;&amp;nbsp;&lt;?php echo $record['habbit']; ?&gt;<br /> &lt;br /&gt;<br /> &lt;?php endforeach; ?&gt;<br /> &lt;/fieldset&gt;<br /><br /><br /><br /> &lt;/div&gt;&lt;/div&gt;</code></p>
<p>Thanks! April</p>]]></description>
          <pubDate>Thu, 14 Aug 2014 09:34:36 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234732#post2234732</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234649#post2234649</link>
          <description><![CDATA[<p>Perfect!</p>
<p>Thanks for all your help!</p>]]></description>
          <pubDate>Thu, 31 Jul 2014 12:17:46 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234649#post2234649</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234640#post2234640</link>
          <description><![CDATA[<p>You'll have to change the code to check if it's set then. Add this:</p>
<p><code>if(isset($_REQUEST['days']) {<br />    $days_TSV = "\t" . implode("\t", $_REQUEST['days'] ) . "\t";<br />}<br />else {<br />    $days_TSV = "";<br />}</code></p>
]]></description>
          <pubDate>Thu, 31 Jul 2014 09:03:24 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234640#post2234640</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234638#post2234638</link>
          <description><![CDATA[<p>Claire, I used that code and now get the following error:</p>
<p>Warning: implode(): Invalid arguments passed in C:\inetpub\charlotteparent\directory\freeform1.php on line 86 </p>

<p>Thanks!</p>
<p>April</p>]]></description>
          <pubDate>Thu, 31 Jul 2014 07:26:55 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234638#post2234638</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234632#post2234632</link>
          <description><![CDATA[<p>Okay, change the line to this:</p>
<p><code>$days_TSV = "\t" . implode("\t", @$_REQUEST['days'] ) . "\t";</code></p>
<p>The form will ignore it if it isn't checked.</p>]]></description>
          <pubDate>Wed, 30 Jul 2014 14:17:01 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234632#post2234632</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234630#post2234630</link>
          <description><![CDATA[<p>Attached! Thanks!</p>]]></description>
          <pubDate>Wed, 30 Jul 2014 13:59:44 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234630#post2234630</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234628#post2234628</link>
          <description><![CDATA[<p>Can you attach your php file here please? I'll take a better look at it.</p>]]></description>
          <pubDate>Wed, 30 Jul 2014 13:33:16 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234628#post2234628</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234627#post2234627</link>
          <description><![CDATA[<p>Thank you!</p>
<p>One last thing and I promise I will stop bothering you today!</p>
<p>I included the coding Dave provided above with my field names:</p>
<p><code>$days_TSV = "\t" . implode("\t", $_REQUEST['days'] ) . "\t";</code></p>
<p>It all works great when I select the category that it associated with. However, when I choose another category that is not associated with that field (days), I get an error undefined index because that fields days is being hidden by my query. </p>
<p>Here is the error: <span>Notice: Undefined index: days in C:\inetpub\charlotteparent\directory\freeform1.php on line 86 Warning: implode(): Invalid arguments passed in C:\inetpub\charlotteparent\directory\freeform1.php on line 86</span></p>
<p>Is there any other way to fix that error when I am selecting other categories?</p>]]></description>
          <pubDate>Wed, 30 Jul 2014 13:02:01 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234627#post2234627</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234613#post2234613</link>
          <description><![CDATA[<p>Hi April</p>
<p>I'd do this by checking the variables in the $_REQUEST as the page loads, and then triggering the Javascript to hide/show different fields as needed if there's an error and the same form needs to be shown again. It can be easy to implement this, or very tricky, depending on how the Javascript is set up. There's no quick fix for it, unfortunately, but a basic version would take about an hour of programming time, I think.</p>]]></description>
          <pubDate>Wed, 30 Jul 2014 11:36:44 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234613#post2234613</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234578#post2234578</link>
          <description><![CDATA[<p>On this question: 2) How do I keep the selected fields for the chosen category (that are shown upon category selection using the query) to stay on page after user submits form? Of course the page is getting refreshed but I wasn't sure if I need to control that via the jquery or it is something different since the form uses the "preSaveTempId"?</p>
<p>I am not having a problem with the option selected. The issue is with the fields that I have hidden when the page first loads via the jquery.</p>
<p>Ex: I have a field called Ages that is hidden and only shows after the user selects the Camps category from drop down. Let's say the user forgets to fill out a required field. The error message will pop up but then the Ages field that was only shown with Camps category selection, no longer shows up since the page is refreshed. Same thing happens after the user submits, those fields no longer show up. The main issue is with them being hidden again when there is an error with a required field. Is there anyway to keep those fields populated when that happens?</p>]]></description>
          <pubDate>Tue, 29 Jul 2014 08:16:49 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234578#post2234578</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234492#post2234492</link>
          <description><![CDATA[<p>Thanks so much!</p>
<p>On this question: <span>2) How do I keep the selected fields for the chosen category (that are shown upon category selection using the query) to stay on page after user submits form? Of course the page is getting refreshed but I wasn't sure if I need to control that via the jquery or it is something different since the form uses the "preSaveTempId"?</span></p>
<p>I am not having a problem with the option selected. The issue is with the fields that I have hidden when the page first loads via the jquery.</p>
<p>Ex: I have a field called Ages that is hidden and only shows after the user selects the Camps category from drop down. Let's say the user forgets to fill out a required field. The error message will pop up but then the Ages field that was only shown with Camps category selection, no longer shows up since the page is refreshed. Same thing happens after the user submits, those fields no longer show up. The main issue is with them being hidden again when there is an error with a required field. Is there anyway to keep those fields populated when that happens?</p>]]></description>
          <pubDate>Fri, 18 Jul 2014 13:51:44 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234492#post2234492</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234484#post2234484</link>
          <description><![CDATA[<p>Hi April,</p>
<p>Sorry for the delay, this is getting more into custom programming but I'll try and give you some tips to point you in the right direction.</p>
<p>The only way to get PHP to accept multiple fields with the same name is to add [] after the fieldname, like this:</p>
<p><code>&lt;input type="checkbox" name="services_provided<span style="color:#ff0000;">[]</span>" ...</code></p>
<p>This will save the value(s) to $_REQUEST['services_provided'] but as an array.<br />More details: <a href="http://stackoverflow.com/questions/7880619/multiple-inputs-with-same-name-through-post-in-php" rel="nofollow">http://stackoverflow.com/questions/7880619/multiple-inputs-with-same-name-through-post-in-php</a></p>
<p>Then to store them in MySQL you need to convert the multiple values into the same format CMSB uses internally, which is tab padded and separated.  (tab)like(tab)this(tab)</p>
<p><code>$services_provided_TSV = "\t" . implode("\t", $_REQUEST['services_provided'] ) . "\t";</code></p>
<p>Then save that to MySQL.</p>
<blockquote>
<p>2) How do I keep the selected fields for the chosen category (that are shown upon category selection using the query) to stay on page after user submits form? Of course the page is getting refreshed but I wasn't sure if I need to control that via the jquery or it is something different since the form uses the "preSaveTempId"?</p>
</blockquote>
<p>You need to check each option value in the category pulldown and add selected="selected" if it's been selected.  The code you have here should do it?  &lt;?php selectedIf($value, @$_REQUEST['category']);?&gt;</p>
<p>Hope that helps!</p>]]></description>
          <pubDate>Thu, 17 Jul 2014 14:09:26 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234484#post2234484</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234392#post2234392</link>
          <description><![CDATA[<p>Thanks! I created the query to show and hide fields based on category perfectly.</p>

<p>Here are the only issues I have now?</p>
<p>1)  One of my fields is a multi value list using checkboxes. I can get the checkboxes to display on the form but when I fill out the form and select more than one option, it only records one option in the database instead of both options that were checked by user on form. How can I fix that so it records all checked selections? See line 322 of my code.</p>

<p>2) How do I keep the selected fields for the chosen category (that are shown upon category selection using the query) to stay on page after user submits form? Of course the page is getting refreshed but I wasn't sure if I need to control that via the jquery or it is something different since the form uses the "preSaveTempId"?</p>

]]></description>
          <pubDate>Thu, 10 Jul 2014 12:01:13 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234392#post2234392</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234349#post2234349</link>
          <description><![CDATA[<p>Hi April, </p>
<p>This is actually how our field editor in the CMS works.  As you select different field types it hides and shows the relevant related fields.</p>
<p>Usually how it's done is to create a form with all the possible fields, then use jquery to hide and show them in realtime as the user makes selections.  Here's some links to jquery:</p>
<ul><li><a href="http://api.jquery.com/hide/" rel="nofollow">http://api.jquery.com/hide/</a></li>
<li><a href="http://api.jquery.com/show/" rel="nofollow">http://api.jquery.com/show/</a></li>
</ul><p>If you're not familiar with jquery it can take a bit to learn, but it's very powerful.  <a href="http://learn.jquery.com/" rel="nofollow">http://learn.jquery.com/</a></p>
<p>Hope that helps!</p>]]></description>
          <pubDate>Thu, 03 Jul 2014 10:07:13 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234349#post2234349</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234310#post2234310</link>
          <description><![CDATA[<p>I have a custom form and was wondering is there anyway to only show certain fields in form based on what category the user selects?</p>
<p>Here is my form : </p>
<p><a href="http://www.charlotteparent.com/directory/freeform.php" rel="nofollow">http://www.charlotteparent.com/directory/freeform.php</a></p>
<p>Ex: If the user picks Baby Fair from category list, then an additional field will pop up to input Babies ages. I just want to create one form instead of a separate form for each category. Just trying to figure out how I could have certain associated fields show up based on the category the user selects.</p>
<p>Thanks!</p>
<p>April</p>]]></description>
          <pubDate>Mon, 30 Jun 2014 08:26:28 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234310#post2234310</guid>
        </item>
                <item>
          <title>Form fields in custom form</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234277#post2234277</link>
          <description><![CDATA[<p>I have a custom form and was wondering is there anyway to only show certain fields in form based on what category the user selects?</p>
<p>Here is my form : </p>
<p><a href="http://www.charlotteparent.com/directory/freeform.php" rel="nofollow">http://www.charlotteparent.com/directory/freeform.php</a></p>
<p>Ex: If the user picks Baby Fair from category list, then an additional field will pop up to input Babies ages. I just want to create one form instead of a separate form for each category. Just trying to figure out how I could have certain associated fields show up based on the category the user selects.</p>

<p>Thanks!</p>
<p>April</p>]]></description>
          <pubDate>Thu, 26 Jun 2014 11:09:01 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234277#post2234277</guid>
        </item>
              </channel>
    </rss>
  