<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1047644" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1047644</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Holy cow, thank you SO much! </title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/dynamically-populated-dropdown-lists-based-selection-ano#comment-1253754</link>
    <description> &lt;p&gt;Holy cow, thank you SO much!  I&#039;m already using a little jQuery for some field visibility toggling, so this should work fine!&lt;/p&gt;
 </description>
     <pubDate>Tue, 14 Sep 2010 16:24:59 +0000</pubDate>
 <dc:creator>Dami</dc:creator>
 <guid isPermaLink="false">comment 1253754 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Oh, now I see. You are</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/dynamically-populated-dropdown-lists-based-selection-ano#comment-1253753</link>
    <description> &lt;p&gt;Oh, now I see. You are changing the name of a feature. I missed the boat on that &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Is there any way for JS to trigger a mysql query?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Indirectly, yes. You need to make a call to PHP using an AJAX request. &lt;/p&gt;
&lt;p&gt;If you are willing to use &lt;a href=&quot;http://jquery.com&quot;&gt;jQuery&lt;/a&gt;, you can use code like:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;// Attach events after the DOM is fully loaded&lt;br /&gt;$(document).ready(function(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create a change event on your main select box&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&amp;#039;#feat_category&amp;#039;).bind(&amp;#039;change&amp;#039;, function(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the category_id from the drop down&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var category_id = $(this).val();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // make a call to features_for_category.php with a GET parameter called category_id that contains&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the category_id. Your PHP code only needs to generate a select box for the features in that&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // category&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.get(&amp;#039;/features_for_category.php&amp;#039;, {&amp;#039;category_id&amp;#039; : category_id}, function(select_box){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the content of your PHP script (a select box) and insert it into the page (you need &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // to create a new div called #features-drop-down-wrapper in your HTML&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&amp;#039;#features-drop-down-wrapper&amp;#039;).html(select_box);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;});&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
There are a half dozen things going on in that code, but hopefully you get the gist of what is happening.&lt;/p&gt;
 </description>
     <pubDate>Tue, 14 Sep 2010 16:06:00 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1253753 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>The purpose of this form is</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/dynamically-populated-dropdown-lists-based-selection-ano#comment-1253728</link>
    <description> &lt;p&gt;The purpose of this form is so the site admin can edit the table contents, like changing the category and/or feature.  Is there any way for JS to trigger a mysql query?  Example, using the onChange event of the category to trigger the query to populate the features based on the selected item in category? &lt;/p&gt;
&lt;p&gt;My other option is to list both category and feature in one drop down, but make the text field only change the feature.  Not an elegant solution....&lt;/p&gt;
&lt;p&gt;Thanks so much for looking over my problem! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 14 Sep 2010 04:12:04 +0000</pubDate>
 <dc:creator>Dami</dc:creator>
 <guid isPermaLink="false">comment 1253728 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I don&#039;t think you can</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/dynamically-populated-dropdown-lists-based-selection-ano#comment-1253727</link>
    <description> &lt;p&gt;I don&#039;t think you can accomplish that without using JavaScript. JavaScript can be painful, especially if you are new to it.&lt;/p&gt;
&lt;p&gt;Have you thought about displaying all the categories and features in a table with radio buttons?&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;+---------------------+-------------------+---------------------+&lt;br /&gt;| Category 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; Category 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp; Category 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;|&amp;nbsp; o Power Steering&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp; o 4 wheel drive |&amp;nbsp;&amp;nbsp; o Battery warmer&amp;nbsp; |&lt;br /&gt;|&amp;nbsp; o Air conditioning |&amp;nbsp;&amp;nbsp; o Hybrid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp; o LED headlights&amp;nbsp; |&lt;br /&gt;+---------------------+-------------------+---------------------+&lt;br /&gt;| Category 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;|&amp;nbsp; o Trunk monkey&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;+---------------------+&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
That is easier to write and it is more usable (I hate drop down boxes).&lt;/p&gt;
 </description>
     <pubDate>Tue, 14 Sep 2010 03:30:00 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1253727 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
