<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>huanix &#187; JavaScript</title>
	<atom:link href="http://www.huanix.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.huanix.com</link>
	<description>chown -R huanix /</description>
	<lastBuildDate>Sat, 31 Dec 2011 14:53:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dynamic Dependent Drop Down Select Forms using PHP, MySQL, and JavaScript</title>
		<link>http://www.huanix.com/2006/12/25/dynamic-dependent-drop-down-select-forms-using-php-mysql-and-javascript/</link>
		<comments>http://www.huanix.com/2006/12/25/dynamic-dependent-drop-down-select-forms-using-php-mysql-and-javascript/#comments</comments>
		<pubDate>Mon, 25 Dec 2006 21:39:53 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=15</guid>
		<description><![CDATA[I knew it was possible to create a dynamic dependent drop down form using PHP, MySQL, and JavaScript, but I had never had an excuse to use one before my Christmas-break project. I have always thought the forms were neat &#8211; like when you select a Country and the next drop-down automagically displays the states [...]]]></description>
			<content:encoded><![CDATA[<p>I knew it was possible to create a dynamic dependent drop down form using PHP, MySQL, and JavaScript, but I had never had an excuse to use one before my Christmas-break project. I have always thought the forms were neat &#8211; like when you select a Country and the next drop-down automagically displays the states from that country. These are also referred to as drill down menus.<br />
It&#8217;s &#8220;family time&#8221;, so I&#8217;m building a basic inventory control system for the school I work at, and one of the basic goals is that users would select their &#8220;hardware type&#8221; (tv, pc computer, mac computer, laptop, etc.) and subsequently select the model # from a list rather than entering it manually. In addition, an administrator has the option to add both hardware types and models to the list at his/her discretion.</p>
<p>All of these things require a dynamic dependent drop down list. I found several resources for completing this task, and after several hours of work, I got it to work using what I believe is the simplest method. You may be far more skilled than I am, and this may be a breeze for you, but I have very little knowledge of JavaScript, so I relied on PHP as much as possible.<br />
Many folks use DreamWeaver to create these menus &#8211; I am challenge-oriented, so all of my techniques refer to hand-coded methods.</p>
<p>The first and most highly regarded source for creating dependent dynamic drop downs is the <a href="http://www.mattkruse.com/javascript/dynamicoptionlist/">Matt Kruse method</a>, Matt has written an extensive JavaScript library that simplifies the entire dynamic dropdown task.. and it does, but because of my unfamiliarity with JavaScript, I had trouble adding the database through PHP.<br />
I was initially stoked about an AJAX method, and I found one at <a href="http://www.webmonkey.com/webmonkey/06/15/index3a_page2.html?tw=authoring">webmonkey</a>, but I am a novice to AJAX, and I couldn&#8217;t make it happen.<br />
I also tried <a href="http://www.codefixer.com/codesnippets/dynamically_dependent_dropdown_lists.asp">codefixer</a>, but after some struggling, I decided it wasn&#8217;t the method for me.</p>
<p>All of this to say, I did eventually find the magic, and it was relatively easy to use (if you add a trick). The source is at <a href="http://p2p.wrox.com/topic.asp?TOPIC_ID=17383">wrox</a>, and the trick I used to make it work was to create a simulated database using their structure, and slowly migrate it over to my setup. It worked really well, used a minimum of code, and does the job perfectly!</p>
<p><strong> Here is my cleaned up and working version of the script:<a href="http://www.huanix.com/files/dependent_select/dependent_select.php">http://www.huanix.com/files/dependent_select/dependent_select.php</a></strong></p>
<h4>Incoming search terms:</h4><ul><li>php dependent drop down list</li><li>dependent dropdown in php</li><li>dependent drop down list in php</li><li>php dependent drop down</li><li>dependent drop down list php</li><li>dependent drop down php</li><li>dependent dropdown php</li><li>php dependent dropdown</li><li>dependent dropdowns php</li><li>php mysql dynamic dropdown</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2006/12/25/dynamic-dependent-drop-down-select-forms-using-php-mysql-and-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

