<?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: drop down with other option</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: drop down with other option</description>
<language>en</language>
<pubDate>Sat, 07 Nov 2026 07:21:29 +0000</pubDate>

<item>
<title>Yogoi on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-6611</link>
<pubDate>Thu, 16 Jul 2009 20:07:25 +0000</pubDate>
<dc:creator>Yogoi</dc:creator>
<guid isPermaLink="false">6611@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I now use what Redityo posted.&#60;br /&#62;
Except like in my last post i try to get 2 of those &#34;other&#34; options that create a textfield.&#60;br /&#62;
added a $('#li_10').hide(); line to hide the 2nd line i want hidden.&#60;/p&#62;
&#60;p&#62;i basically did the same for the script. ppasted a 2nd version of the function showTextBox() with the corretc lines into the same script.&#60;/p&#62;
&#60;p&#62;weird thing is, only the 2nd other option works.&#60;br /&#62;
the same happens when i create 2 seperate script codes.
&#60;/p&#62;</description>
</item>
<item>
<title>Yogoi on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-6605</link>
<pubDate>Thu, 16 Jul 2009 16:09:07 +0000</pubDate>
<dc:creator>Yogoi</dc:creator>
<guid isPermaLink="false">6605@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm also on this problem.&#60;br /&#62;
i got it working after some trial and error.&#60;/p&#62;
&#60;p&#62;but now i wanted to have a 2nd dropdown menu with a text field apearing on 1 of the options.&#60;/p&#62;
&#60;p&#62;Do i just need to copy paste the &#38;lt;script&#38;gt; and the documenet ready hide function?&#60;br /&#62;
(1 time the element markup is enough right?)&#60;/p&#62;
&#60;p&#62;Thats what i tried so far, except that i somehow cant seem to get the paragraph text boxes to be hidden from the start anymore, and i only get 1 dropdownbox working (the text box does dissapear when i select a non text box option)&#60;/p&#62;
&#60;p&#62;any idea's?
&#60;/p&#62;</description>
</item>
<item>
<title>sendedge on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-6530</link>
<pubDate>Fri, 10 Jul 2009 02:17:31 +0000</pubDate>
<dc:creator>sendedge</dc:creator>
<guid isPermaLink="false">6530@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm also trying to create a field hide/show depending on a radio button (multiple choice). I will try this. Though, the question I have is this...&#60;/p&#62;
&#60;p&#62;Does this mean that the custom application of the hide/show will carry over to every other form too because dont they all share the view-functions.php file?
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-6087</link>
<pubDate>Thu, 04 Jun 2009 10:46:49 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">6087@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm it seems you've set the wrong id. In your form you have drop down id = 4 and text box id = 6, then java script code should be like this :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;

	{$add_jquery}

	function showTextBox() {
		//reset text box value
		$(&#38;#39;#element_6&#38;#39;).val(&#38;#39;&#38;#39;);

		//show hide the field
		//change the value based on your &#38;quot;other&#38;quot; selection value
		if ($(&#38;#39;#element_4&#38;#39;).val() == &#38;#39;7&#38;#39;) {
			$(&#38;#39;#li_6&#38;#39;).show();
		} else  {
			$(&#38;#39;#li_6&#38;#39;).hide();
		}
	}

&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and make sure you set this code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$_GET[&#38;#39;id&#38;#39;] == 1&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;to &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$_GET[&#38;#39;id&#38;#39;] == 4&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>ptrptr on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-6084</link>
<pubDate>Thu, 04 Jun 2009 03:11:27 +0000</pubDate>
<dc:creator>ptrptr</dc:creator>
<guid isPermaLink="false">6084@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Here is demo page I am testing.&#60;br /&#62;
&#60;a href=&#34;http://www.pharmedixrx.com/machform/view.php?id=4&#34; rel=&#34;nofollow&#34;&#62;http://www.pharmedixrx.com/machform/view.php?id=4&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I made all the change above. It seems Java Script is not working!
&#60;/p&#62;</description>
</item>
<item>
<title>ptrptr on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-6083</link>
<pubDate>Thu, 04 Jun 2009 02:18:28 +0000</pubDate>
<dc:creator>ptrptr</dc:creator>
<guid isPermaLink="false">6083@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I follow your instruction but It did not work. &#60;/p&#62;
&#60;p&#62;Here is another way to look at it.&#60;br /&#62;
My form has more than 10 field using drop down choice. Currently All field has 6 choices.&#60;br /&#62;
Order 5&#60;br /&#62;
Order 10&#60;br /&#62;
Order 15&#60;br /&#62;
Order 20&#60;br /&#62;
Order 25&#60;br /&#62;
Order 30&#60;/p&#62;
&#60;p&#62;I want to add 7th choice to be &#34;Other&#34;&#60;br /&#62;
Order 5&#60;br /&#62;
Order 10&#60;br /&#62;
Order 15&#60;br /&#62;
Order 20&#60;br /&#62;
Order 25&#60;br /&#62;
Order 30&#60;br /&#62;
Other&#60;/p&#62;
&#60;p&#62;When I choose &#34;other&#34;, I want to have a new text field to enter any number outside of my choice in the same field.&#60;/p&#62;
&#60;p&#62;Is your solution work as I described?
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-5552</link>
<pubDate>Wed, 22 Apr 2009 12:54:55 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">5552@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I think you can put a &#34;text box&#34; for another order number and show when the user select &#34;other&#34;. To do this You need to hack some code to machform files , let's say you have form id = 1 with these element :&#60;/p&#62;
&#60;p&#62;- order choice field  [ element id = 1] --&#38;gt; I assume &#34;other&#34; selection value is &#34;2&#34;&#60;br /&#62;
- text box field [element id = 2]&#60;/p&#62;
&#60;p&#62;After that you should edit &#34;includes/view-functions.php&#34; file, try to following these steps :&#60;/p&#62;
&#60;p&#62;1. Go to around line 648 ~ 647, you will see these code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$element_markup = &#38;lt;&#38;lt;&#38;lt;EOT
		&#38;lt;li id=&#38;quot;li_{$element-&#38;gt;id}&#38;quot; {$error_class}&#38;gt;
		&#38;lt;label class=&#38;quot;description&#38;quot; for=&#38;quot;element_{$element-&#38;gt;id}&#38;quot;&#38;gt;{$element-&#38;gt;title} {$span_required}&#38;lt;/label&#38;gt;
		&#38;lt;div&#38;gt;
		&#38;lt;select class=&#38;quot;element select {$element-&#38;gt;size}&#38;quot; id=&#38;quot;element_{$element-&#38;gt;id}&#38;quot; name=&#38;quot;element_{$element-&#38;gt;id}&#38;quot; &#38;gt;
			{$option_markup}
		&#38;lt;/select&#38;gt;
		&#38;lt;/div&#38;gt;{$guidelines} {$error_message}
		&#38;lt;/li&#38;gt;
EOT;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;replace with &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($_GET[&#38;#39;id&#38;#39;] == 1) {
	$add_event = &#38;#39;onchange=&#38;quot;javascript:showTextBox()&#38;quot;&#38;#39;;
}
$element_markup = &#38;lt;&#38;lt;&#38;lt;EOT
		&#38;lt;li id=&#38;quot;li_{$element-&#38;gt;id}&#38;quot; {$error_class}&#38;gt;
		&#38;lt;label class=&#38;quot;description&#38;quot; for=&#38;quot;element_{$element-&#38;gt;id}&#38;quot;&#38;gt;{$element-&#38;gt;title} {$span_required}&#38;lt;/label&#38;gt;
		&#38;lt;div&#38;gt;
		&#38;lt;select class=&#38;quot;element select {$element-&#38;gt;size}&#38;quot; id=&#38;quot;element_{$element-&#38;gt;id}&#38;quot; name=&#38;quot;element_{$element-&#38;gt;id}&#38;quot; {$add_event}&#38;gt;
			{$option_markup}
		&#38;lt;/select&#38;gt;
		&#38;lt;/div&#38;gt;{$guidelines} {$error_message}
		&#38;lt;/li&#38;gt;
EOT;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;2. Go to around line 1833 ~ 1834, you will see this&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//If you would like to remove the &#38;quot;Powered by MachForm&#38;quot; link,..
$form_markup = &#38;lt;&#38;lt;&#38;lt;EOT&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;put the code above that line&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ($_GET[&#38;#39;id&#38;#39;] == 1) {
	$add_jquery =&#38;quot;
		   $(document).ready(function() {
				$(&#38;#39;#li_1&#38;#39;).hide();
		  });
		  &#38;quot;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;3. And finally :) go to line 1841, you will see this &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;js/view.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then add these code, bellow that line&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;js/jquery/jquery-core.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;

	{$add_jquery}

	function showTextBox() {
		//reset text box value
		$(&#38;#39;#element_1&#38;#39;).val(&#38;#39;&#38;#39;);

		//show hide the field
		//change the value based on your &#38;quot;other&#38;quot; selection value
		if ($(&#38;#39;#element_2&#38;#39;).val() == &#38;#39;2&#38;#39;) {
			$(&#38;#39;#li_1&#38;#39;).show();
		} else  {
			$(&#38;#39;#li_1&#38;#39;).hide();
		}
	}

&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>ptrptr on "drop down with other option"</title>
<link>https://www.machform.com/forums/topic/drop-down-with-other-option#post-5546</link>
<pubDate>Wed, 22 Apr 2009 04:08:54 +0000</pubDate>
<dc:creator>ptrptr</dc:creator>
<guid isPermaLink="false">5546@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;My forms are setup as drop down choice.&#60;br /&#62;
I want to add &#34;other&#34; end of the choice so I don't have to create long drop down list.&#60;br /&#62;
The &#34;other&#34; allow user to enter desire order ## outside of the list of choice. Can this be done?&#60;br /&#62;
order 5&#60;br /&#62;
order 10&#60;br /&#62;
order 15&#60;br /&#62;
order 20&#60;br /&#62;
&#34;other&#34;
&#60;/p&#62;</description>
</item>

</channel>
</rss>
