<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Latest posts from topic “[solved] Select Box”</title>
  <subtitle>Latest posts from topic “[solved] Select Box” on “mooforum”.</subtitle>
  <link href="http://www.mooforum.net/viewtopic.php?f=16&amp;t=2832" />
  <updated>2010-01-27T14:48:46Z</updated>
  <id>http://www.mooforum.net/viewtopic.php?f=16&amp;t=2832</id>
  <link rel="self" href="http://www.mooforum.net/generate_feed.php?content=topic_posts&amp;f%5B%5D=16&amp;t=2832" />

			<entry>
			<title>Re: Select Box</title>
			<link href="http://www.mooforum.net/viewtopic.php?f=16&amp;p=10325#p10325"/>
			<id>http://www.mooforum.net/viewtopic.php?f=16&amp;p=10325#p10325</id>
			<author>
				<name>dudeinmo</name>
			</author>
			<published>2010-01-27T15:37:47Z</published>
			<updated>2010-01-27T15:37:47Z</updated>
			<summary type="xhtml">
				<div xmlns="http://www.w3.org/1999/xhtml">Solved my own coding problem .. works in 1.1.2 in jsfiddle anyway.<br />
<br />
<div class="codebox"><div class="codeheader"><a href="#" onclick="linenumberOnOff('cb65393'); return false;">Line number On/Off</a> | <a href="#" onclick="expandCode('cb65393'); return false;">Expand/Contract</a> | <a href="#" onclick="selectCode(this); return false;">Select all</a></div><!-- we need this dummy div to fix a firefox bug when selecting code lines --><div class="codeholder"><div class="text" id="cb65393" style="font-family: monospace;"><ol><li style="" class="li1">window.addEvent('domready', function() {</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> alert(&quot;The DOM is ready.&quot;);</li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> var royal = $('Color_field').getElement('option[value=Royal]');</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> $('Style_field').addEvent('change', function(){</li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]></li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]>myStyle = $('Style_field').value;</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]></li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> if(myStyle == &quot;Long_Sleeve&quot;){</li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> alert(myStyle);</li><li style="" class="li2"><![CDATA[ ]]></li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> royal.setAttribute('disabled',true);</li><li style="" class="li2"><![CDATA[ ]]></li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> }else{</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]>royal.removeAttribute('disabled');</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> }</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> });</li><li style="" class="li1">});</li></ol></div></div></div></div>
			</summary>
		</entry>
			<entry>
			<title>[solved] Select Box</title>
			<link href="http://www.mooforum.net/viewtopic.php?f=16&amp;p=10324#p10324"/>
			<id>http://www.mooforum.net/viewtopic.php?f=16&amp;p=10324#p10324</id>
			<author>
				<name>dudeinmo</name>
			</author>
			<published>2010-01-27T14:48:46Z</published>
			<updated>2010-01-27T14:48:46Z</updated>
			<summary type="xhtml">
				<div xmlns="http://www.w3.org/1999/xhtml">Ok, I originally had this in the 1.2 section, but it's a 1.1 question - I've got most the code - I just have to know how to disable an option in a select dropdown and enable that selection in another function. The below code on JSFIDDLE is what I have so far and it works to do what I need.<br />
<a href="http://www.jsfiddle.net/F5sD9/4/" class="postlink">http://www.jsfiddle.net/F5sD9/4/</a><br />
<br />
All I really need to know is how to disable the Royal option if Long Sleeve is selected. And if short sleeve is reselected the Royal option would show back up.<br />
<br />
<div class="codebox"><div class="codeheader"><a href="#" onclick="linenumberOnOff('cb51142'); return false;">Line number On/Off</a> | <a href="#" onclick="expandCode('cb51142'); return false;">Expand/Contract</a> | <a href="#" onclick="selectCode(this); return false;">Select all</a></div><!-- we need this dummy div to fix a firefox bug when selecting code lines --><div class="codeholder"><div class="text" id="cb51142" style="font-family: monospace;"><ol><li style="" class="li1">&lt;select class=&quot;inputboxattrib&quot; id=&quot;Style_field&quot; name=&quot;Style419&quot;&gt;</li><li style="" class="li2"><![CDATA[ ]]> &lt;option value=&quot;Short_Sleeve&quot;&gt;Short Sleeve&lt;/option&gt;</li><li style="" class="li1"><![CDATA[ ]]> &lt;option value=&quot;Long_Sleeve&quot;&gt;Long Sleeve&lt;/option&gt;</li><li style="" class="li2">&lt;/select&gt;</li><li style="" class="li1"><![CDATA[ ]]></li><li style="" class="li2">&lt;select class=&quot;inputboxattrib&quot; id=&quot;Color_field&quot; name=&quot;Color419&quot;&gt;</li><li style="" class="li1"><![CDATA[ ]]> &lt;option value=&quot;Black&quot;&gt;Black&lt;/option&gt;</li><li style="" class="li2"><![CDATA[ ]]> &lt;option value=&quot;Charcoal&quot;&gt;Charcoal&lt;/option&gt;</li><li style="" class="li1"><![CDATA[ ]]> &lt;option value=&quot;Navy&quot;&gt;Navy&lt;/option&gt;</li><li style="" class="li2"><![CDATA[ ]]> &lt;option value=&quot;Raspberry&quot;&gt;Raspberry&lt;/option&gt;</li><li style="" class="li1"><![CDATA[ ]]> &lt;option value=&quot;Teal&quot;&gt;Teal&lt;/option&gt;</li><li style="" class="li2"><![CDATA[ ]]> &lt;option value=&quot;Kelly&quot;&gt;Kelly&lt;/option&gt;</li><li style="" class="li1"><![CDATA[ ]]> &lt;option value=&quot;Red&quot;&gt;Red&lt;/option&gt;</li><li style="" class="li2"><![CDATA[ ]]> &lt;option value=&quot;Purple&quot;&gt;Purple&lt;/option&gt;</li><li style="" class="li1"><![CDATA[ ]]> &lt;option value=&quot;Orange&quot;&gt;Orange&lt;/option&gt;</li><li style="" class="li2"><![CDATA[ ]]> &lt;option value=&quot;Royal&quot;&gt;Royal&lt;/option&gt;</li><li style="" class="li1">&lt;/select&gt;</li></ol></div></div></div><br />
<br />
<div class="codebox"><div class="codeheader"><a href="#" onclick="linenumberOnOff('cb9483'); return false;">Line number On/Off</a> | <a href="#" onclick="expandCode('cb9483'); return false;">Expand/Contract</a> | <a href="#" onclick="selectCode(this); return false;">Select all</a></div><!-- we need this dummy div to fix a firefox bug when selecting code lines --><div class="codeholder"><div class="text" id="cb9483" style="font-family: monospace;"><ol><li style="" class="li1">window.addEvent('domready', function() {</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> alert(&quot;The DOM is ready.&quot;);</li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> $('Style_field').addEvent('change', function(){</li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]></li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]>myStyle = $('Style_field').value;</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]></li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> if(myStyle == &quot;Long_Sleeve&quot;){</li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> alert(myStyle);</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]></li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> }else{</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]></li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> </li><li style="" class="li1"><![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> <![CDATA[ ]]> }</li><li style="" class="li2"><![CDATA[ ]]> <![CDATA[ ]]> });</li><li style="" class="li1">});</li></ol></div></div></div></div>
			</summary>
		</entry>
	</feed>