<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: Need a little help with javascript and webpage dropdowns..</title>
      <link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns/</link>
      <description>Comments on Ask MetaFilter post Need a little help with javascript and webpage dropdowns..</description>
	  	  <pubDate>Fri, 29 Sep 2006 05:11:56 -0800</pubDate>
      <lastBuildDate>Fri, 29 Sep 2006 05:11:56 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Need a little help with javascript and webpage dropdowns..</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns</link>	
  	<description>Need a little help with javascript.. &lt;br /&gt;&lt;br /&gt; Say I have a page with multiple dropdown boxes, all of which contain exactly the same options. At the minute, I have to click on all of those dropdowns individually, which is very repetitive.&lt;br&gt;
&lt;br&gt;
I was thinking that it might be possible to use javascript to add  a button to that webpage that would select the same option on all the dropdowns on that page. But sadly I don&apos;t know how to do that, and google is no help.. so any help would be appreciated.&lt;br&gt;
&lt;br&gt;
(by the way, it doesn&apos;t have to be javascript - I&apos;m happy to do anything that would help do this.)</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.47544</guid>
  	<pubDate>Fri, 29 Sep 2006 04:26:48 -0800</pubDate>
  	<dc:creator>ascullion</dc:creator>
	
	<category>computers</category>
	
	<category>javascript</category>
	
	<category>programming</category>
	
	<category>webpages</category>
	
	<category>dropdown</category>
	
	<category>internet</category>
	
	<category>computerhelp</category>
	
</item>
<item>
  	<title>By: furtive</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723570</link>	
  	<description>&lt;i&gt;I have a page with multiple dropdown boxes, all of which contain exactly the same options.&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Well that doesn&apos;t make sense at all.&lt;/b&gt;  But a simple solution would be that when you change the value in one dropdown, it automatically changes the value of others. &lt;br&gt;
&lt;br&gt;
add this to your select tags:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;onchange=&amp;quot;toggleAll(this.value)&amp;quot;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
And add this in the head in script tags:&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
function toggleAll(newVal) {&lt;br&gt;
  var selects = document.getElementsByTagName(&amp;quot;select&amp;quot;);&lt;br&gt;
  for (var i = 0; i &lt; selects.length; i++) {br&gt;
    for (var x = 0; i &lt; selects[i] .options.length; x++) {br&gt;
      if (selects[i].options[x].value == newVal) selects[i].options[x].selected = true;    &lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
&lt;/&gt;&lt;/&gt;&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
NOTE:  Take out the &lt;b&gt;br&amp;gt;&lt;/b&gt; that shows up at the end of some lines, that&apos;s Metafilter adding those for reasons unknown to me.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723570</guid>
  	<pubDate>Fri, 29 Sep 2006 05:11:56 -0800</pubDate>
  	<dc:creator>furtive</dc:creator>
</item>
<item>
  	<title>By: furtive</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723571</link>	
  	<description>Oh, missing a closing &lt;b&gt;}&lt;/b&gt; in there.  Sorry.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723571</guid>
  	<pubDate>Fri, 29 Sep 2006 05:14:48 -0800</pubDate>
  	<dc:creator>furtive</dc:creator>
</item>
<item>
  	<title>By: ascullion</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723573</link>	
  	<description>thanks furtive, will try that out.&lt;br&gt;
&lt;br&gt;
BTW.. as to it not making sense. It&apos;s a movable type &apos;approve comments&apos; page. possibly i should have said that above.. so you have x number of comments, and each has a drop-down - approve, reject, junk, etc etc</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723573</guid>
  	<pubDate>Fri, 29 Sep 2006 05:15:22 -0800</pubDate>
  	<dc:creator>ascullion</dc:creator>
</item>
<item>
  	<title>By: ascullion</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723576</link>	
  	<description>oh, actually... i need the page to have slightly more flexibility..&lt;br&gt;
&lt;br&gt;
ideally.. i could choose to control them all at once, or choose to do them individually. from reading the above, wouldn&apos;t that solution &lt;i&gt;only&lt;/i&gt; allow me to control them all at once?</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723576</guid>
  	<pubDate>Fri, 29 Sep 2006 05:17:38 -0800</pubDate>
  	<dc:creator>ascullion</dc:creator>
</item>
<item>
  	<title>By: spaceman_spiff</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723579</link>	
  	<description>Correct.  The solution is to create a new dropdown, and only have that dropdown call onchange.  That would change everything to the value of your new dropdown, but you could then make any modifications you wanted.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723579</guid>
  	<pubDate>Fri, 29 Sep 2006 05:19:38 -0800</pubDate>
  	<dc:creator>spaceman_spiff</dc:creator>
</item>
<item>
  	<title>By: ascullion</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723583</link>	
  	<description>aha, thanks for that. will try it out.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723583</guid>
  	<pubDate>Fri, 29 Sep 2006 05:22:18 -0800</pubDate>
  	<dc:creator>ascullion</dc:creator>
</item>
<item>
  	<title>By: ascullion</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723597</link>	
  	<description>thanks for all the help so far, is much appreciated.&lt;br&gt;
&lt;br&gt;
have tried that out.. but can&apos;t quite get it to work. just be to clear.. i really only have very little idea what i&apos;m doing..&lt;br&gt;
&lt;br&gt;
two questions..&lt;br&gt;
&lt;br&gt;
1 - am i right in thinking that if this works, i would be able to actualyl see the dropdowns across the page changing?&lt;br&gt;
&lt;br&gt;
2 - i suspect that what i&apos;m getting wrong is i&apos;m building my &apos;control all&apos; dropdown wrongly. here&apos;s the code i&apos;m using.. anything obviously not right?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;lt;select onchange=&amp;quot;toggleAll(this.value)&amp;quot;&amp;gt;&lt;br&gt;&lt;br&gt;
			&amp;lt;option value=&amp;quot;nothing&amp;quot; selected&amp;gt;Select...&amp;lt;/option&amp;gt;&lt;br&gt;
			&lt;br&gt;&lt;br&gt;
			&amp;lt;option value=&amp;quot;approve&amp;quot; &amp;gt;Approve&amp;lt;/option&amp;gt;&lt;br&gt;
			&lt;br&gt;&lt;br&gt;
			&amp;lt;option value=&amp;quot;defer&amp;quot; &amp;gt;Defer&amp;lt;/option&amp;gt;&lt;br&gt;
			&lt;br&gt;&lt;br&gt;
			&amp;lt;option value=&amp;quot;delete&amp;quot; &amp;gt;Delete&amp;lt;/option&amp;gt;&lt;br&gt;
			&lt;br&gt;&lt;br&gt;
			&amp;lt;option value=&amp;quot;reject&amp;quot; &amp;gt;Reject&amp;lt;/option&amp;gt;&lt;br&gt;
			&lt;br&gt;&lt;br&gt;
			&amp;lt;option value=&amp;quot;junk&amp;quot; &amp;gt;Junk&amp;lt;/option&amp;gt;&lt;br&gt;
			&lt;br&gt;&lt;br&gt;
			&amp;lt;option value=&amp;quot;moderate&amp;quot; &amp;gt;Pending&amp;lt;/option&amp;gt;&lt;br&gt;
			&lt;br&gt;
	&amp;lt;/select&amp;gt;&lt;br&gt;&lt;br&gt;
&lt;/font&gt;</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723597</guid>
  	<pubDate>Fri, 29 Sep 2006 05:38:11 -0800</pubDate>
  	<dc:creator>ascullion</dc:creator>
</item>
<item>
  	<title>By: juggler</title>
  	<link>http://ask.metafilter.com/47544/Need-a-little-help-with-javascript-and-webpage-dropdowns#723662</link>	
  	<description>FWIW, this is my &amp;quot;Go To&amp;quot; page for getting any JS answers. It is a decent JS FAQ. &lt;br&gt;
&lt;a href=&quot;http://irt.org/script/form.htm&quot;&gt;JavaScript Form Contents&lt;/a&gt;</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.47544-723662</guid>
  	<pubDate>Fri, 29 Sep 2006 07:27:22 -0800</pubDate>
  	<dc:creator>juggler</dc:creator>
</item>

    </channel>
</rss>
