<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1036218" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1036218</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/conditional-form-options#comment-1218584</link>
    <description> &lt;p&gt;I&#039;m back at this again! I had put it on the back burner for awhile but my boss mentioned that it would be good to have for our next marketing push.&lt;/p&gt;
&lt;p&gt;Now I&#039;m thinking about using some combination of PHP &amp;amp; javascript. Now I have all the possible values stored in three database tables (residences - for the residence names &amp;amp; types, meal plans - for the meal plan types &amp;amp; costs, and details.Oops, forgot something for the terms available ... hmmm...)&lt;/p&gt;
&lt;p&gt;Anyway, does anyone have any suggestions for how I could pull the values from the database and then change the available items when something from one field is selected?&lt;/p&gt;
&lt;p&gt;Here is my current prototype page (a bit of a mess right now):&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.housing.uwaterloo.ca/_testbed/calculator/calculator.php&quot; class=&quot;bb-url&quot;&gt;http://www.housing.uwaterloo.ca/_testbed/calculator/calculator.php&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 30 Apr 2007 20:41:31 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1218584 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/conditional-form-options#comment-1208818</link>
    <description> &lt;p&gt;Okay, well, I&#039;m sorting through some of the other options but I might try what you&#039;ve got there and see how far I get &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>Mon, 16 Oct 2006 16:05:26 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1208818 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/conditional-form-options#comment-1208817</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Megan;208815 wrote:&lt;/strong&gt; Yikes, that sounds scary! I&#039;m fiddling around with this and doing what I can  - I have no idea how to do a lot of what you mentioned there! Will have to work on my javascript a lot! I found a lot of premade scripts and tutorials and stuff so I&#039;ll work from there...&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Don&#039;t worry, it only seems scary because I&#039;ve run through it very quickly from top to bottom.  I&#039;m hoping it&#039;ll give you ideas if you should get stuck, rather than prescribing a solution.  &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>Mon, 16 Oct 2006 15:45:45 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1208817 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/conditional-form-options#comment-1208815</link>
    <description> &lt;p&gt;Yikes, that sounds scary! I&#039;m fiddling around with this and doing what I can  - I have no idea how to do a lot of what you mentioned there! Will have to work on my javascript a lot! I found a lot of premade scripts and tutorials and stuff so I&#039;ll work from there...&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Oct 2006 15:36:14 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1208815 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/conditional-form-options#comment-1208812</link>
    <description> &lt;p&gt;It&#039;s an interesting problem, and definitely do-able on one page with Javascript alone.&lt;/p&gt;
&lt;p&gt;A rough sketch of one possible approach for the script:&lt;/p&gt;
&lt;ol class=&quot;bb-list&quot;&gt;
&lt;li&gt; Define each &lt;em&gt;term&lt;/em&gt; (just a name, really) and group them in one array.&lt;/li&gt;
&lt;li&gt; Define each &lt;em&gt;residence&lt;/em&gt;, including a reference to which parent &lt;em&gt;term&lt;/em&gt;(s) it can be in, and its &lt;em&gt;cost&lt;/em&gt;, and group in another array.&lt;/li&gt;
&lt;li&gt; ... similarly for &lt;em&gt;room type&lt;/em&gt;s and &lt;em&gt;meal plan&lt;/em&gt;s, with references to parent &lt;em&gt;residences&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt; Populate the first selection box with all &lt;em&gt;term&lt;/em&gt;s, leaving the other boxes empty.&lt;/li&gt;
&lt;li&gt; When the onChange event happens for the &lt;em&gt;term&lt;/em&gt;s selection box, filter away all the &lt;em&gt;residence&lt;/em&gt;s which aren&#039;t children the chosen &lt;em&gt;term&lt;/em&gt;, and populate the &lt;em&gt;residence&lt;/em&gt;s selection box with the result.&lt;/li&gt;
&lt;li&gt; ... similarly for the onChange event on the &lt;em&gt;residence&lt;/em&gt;s selection, filter out &lt;em&gt;room type&lt;/em&gt;s and &lt;em&gt;meal plan&lt;/em&gt;s, and populate their boxes.&lt;/li&gt;
&lt;li&gt; Either keep a running total, or calculate the total when the last item is chosen, and display it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For steps 1-3, you could use &lt;a href=&quot;http://www.javascriptkit.com/javatutors/proto.shtml&quot; class=&quot;bb-url&quot;&gt;prototypes&lt;/a&gt; to define &lt;em&gt;term&lt;/em&gt;s etc and their properties.  To filter and populate the selection boxes, you&#039;d loop over the arrays, and use the DOM &lt;a href=&quot;http://www.w3schools.com/dom/dom_node.asp&quot; class=&quot;bb-url&quot;&gt;Node&lt;/a&gt; &lt;a href=&quot;http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-184E7107&quot; class=&quot;bb-url&quot;&gt;methods&lt;/a&gt; to add  elements.&lt;/p&gt;
&lt;p&gt;I guess that&#039;ll be the basic functionality.  From there, it would be easy to make it possible, say, to:&lt;/p&gt;
&lt;ul class=&quot;bb-list&quot;&gt;
&lt;li&gt; make the selections in any order (maybe starting with a residence, and it changes the term options).&lt;/li&gt;
&lt;li&gt; highlight with some styling which options haven&#039;t been explicitly chosen.&lt;/li&gt;
&lt;li&gt; have default &quot;heading&quot; options.&lt;/li&gt;
&lt;li&gt; write the initial data in a simpler form (like comma-separated text), and have the script generate prototypes from that.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Megan wrote:&lt;/strong&gt;&lt;br /&gt;
But then, I haven&#039;t coded javascript myself in years so this could be an adventure!&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Should be fun!  Remember to build it incrementally and keep it simple.  Good luck.  &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>Mon, 16 Oct 2006 15:19:39 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1208812 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/conditional-form-options#comment-1208785</link>
    <description> &lt;p&gt;Thanks, Busy. It will be on just one page I think. I think the calculations would be easy. Switching the values for each form depending on another value is what I&#039;m really not sure about.&lt;/p&gt;
&lt;p&gt;But then, I haven&#039;t coded javascript myself in years so this could be an adventure!&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Oct 2006 13:27:31 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1208785 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/conditional-form-options#comment-1208616</link>
    <description> &lt;p&gt;Is it to be done on one page or several?&lt;/p&gt;
&lt;p&gt;Javascript is the only way if on one page (with use of css of hiding the other stuff etc) but if you want several pages then just server side or static html would do.&lt;/p&gt;
&lt;p&gt;Have a look for javascript quiz code if you want some base code to work from, something from this lot may be of some help&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://javascriptkit.com/script/script2/picklist.shtml&quot; class=&quot;bb-url&quot;&gt;http://javascriptkit.com/script/script2/picklist.shtml&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javascriptkit.com/script/script2/picklist2.shtml&quot; class=&quot;bb-url&quot;&gt;http://javascriptkit.com/script/script2/picklist2.shtml&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javascriptkit.com/script/script2/comboquiz.shtml&quot; class=&quot;bb-url&quot;&gt;http://javascriptkit.com/script/script2/comboquiz.shtml&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javascriptkit.com/script/cut180.shtml&quot; class=&quot;bb-url&quot;&gt;http://javascriptkit.com/script/cut180.shtml&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javascriptkit.com/script/cut142.shtml&quot; class=&quot;bb-url&quot;&gt;http://javascriptkit.com/script/cut142.shtml&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 13 Oct 2006 21:10:15 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1208616 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
