<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: JQuery: Playing with Select (DropDownList/ComboBox)</title>
	<atom:link href="http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/</link>
	<description></description>
	<lastBuildDate>Tue, 16 Mar 2010 00:33:33 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jacques</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-48018</link>
		<dc:creator>Jacques</dc:creator>
		<pubDate>Thu, 30 Jul 2009 15:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-48018</guid>
		<description>Very consise article, with everything I wanted to know about jQuery and select-options or drop down lists. Thanks so much!</description>
		<content:encoded><![CDATA[<p>Very consise article, with everything I wanted to know about jQuery and select-options or drop down lists. Thanks so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sebastien</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47973</link>
		<dc:creator>sebastien</dc:creator>
		<pubDate>Tue, 28 Jul 2009 09:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47973</guid>
		<description>Hi, I&#039;m french and i have a problem. Maybe coud you help me.
I use combobox 
here : http://jquery.sanchezsalvador.com/jquery/page/jquerycomboboxapi.aspx

And i put an onchange on my select. With &quot;onchange&quot;, a &quot;option&quot; is like an &quot;a href&quot;.

But there is no result. 
Could you help me please ?</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m french and i have a problem. Maybe coud you help me.<br />
I use combobox<br />
here : <a href="http://jquery.sanchezsalvador.com/jquery/page/jquerycomboboxapi.aspx" rel="nofollow">http://jquery.sanchezsalvador.com/jquery/page/jquerycomboboxapi.aspx</a></p>
<p>And i put an onchange on my select. With &#8220;onchange&#8221;, a &#8220;option&#8221; is like an &#8220;a href&#8221;.</p>
<p>But there is no result.<br />
Could you help me please ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Brandsma</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47878</link>
		<dc:creator>Chris Brandsma</dc:creator>
		<pubDate>Fri, 24 Jul 2009 14:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47878</guid>
		<description>@mark,  as far as I know, a dropdown ALWAYS has a selected item.  By default it is the first item in the list.  So your dropdown needs a blank item in it if you want a &#039;nonselected&#039; option.

The alternative is to not use a dropdown at all.  Instead use a textbox that links to a hidden div that dispalys when the textbox is selected/clicked.  The JQuery Calendar control does this.</description>
		<content:encoded><![CDATA[<p>@mark,  as far as I know, a dropdown ALWAYS has a selected item.  By default it is the first item in the list.  So your dropdown needs a blank item in it if you want a &#8216;nonselected&#8217; option.</p>
<p>The alternative is to not use a dropdown at all.  Instead use a textbox that links to a hidden div that dispalys when the textbox is selected/clicked.  The JQuery Calendar control does this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Puddephatt</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47876</link>
		<dc:creator>Mark Puddephatt</dc:creator>
		<pubDate>Fri, 24 Jul 2009 13:23:03 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47876</guid>
		<description>OK sorry about this, but the comments box doesnt like html code! But the prepend has an option tag inside the quotes...</description>
		<content:encoded><![CDATA[<p>OK sorry about this, but the comments box doesnt like html code! But the prepend has an option tag inside the quotes&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Puddephatt</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47875</link>
		<dc:creator>Mark Puddephatt</dc:creator>
		<pubDate>Fri, 24 Jul 2009 13:20:35 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47875</guid>
		<description>&lt;a href=&quot;#comment-47874&quot; rel=&quot;nofollow&quot;&gt;@Mark Puddephatt &lt;/a&gt; 

Whoop a bit of my script seems to have got lost, it should be:

$(&quot;#dropdown&quot;).prepend(&quot;&quot;);
$(&quot;#dropdown option:first-child&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);

(without the spaces on the option tags)</description>
		<content:encoded><![CDATA[<p><a href="#comment-47874" rel="nofollow">@Mark Puddephatt </a> </p>
<p>Whoop a bit of my script seems to have got lost, it should be:</p>
<p>$(&#8221;#dropdown&#8221;).prepend(&#8221;");<br />
$(&#8221;#dropdown option:first-child&#8221;).attr(&#8221;selected&#8221;,&#8221;selected&#8221;);</p>
<p>(without the spaces on the option tags)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Puddephatt</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47874</link>
		<dc:creator>Mark Puddephatt</dc:creator>
		<pubDate>Fri, 24 Jul 2009 13:17:25 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47874</guid>
		<description>Hi,

I am looking for a way to trigger a dropdown to clear any value that has been selected from it, so it returns to its default state where nothing is selected.

The best way i&#039;ve found to achieve this is to prepend a blank option to the dropdown and then select that blank option: 

$(&quot;#dropdown&quot;).prepend(&quot;&quot;);
$(&quot;#dropdown option:first-child&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);

But ideally I would prefer not to have a blank option in the dropdown selector so that I dont have to validate the user to ensure they are not submitting a blank value. 

What i&#039;m wondering is if there is a simple way to tell the dropdown to return to the state where nothing is selected, e.g. if there was something like (&quot;#dropdown&quot;).reset - any ideas?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am looking for a way to trigger a dropdown to clear any value that has been selected from it, so it returns to its default state where nothing is selected.</p>
<p>The best way i&#8217;ve found to achieve this is to prepend a blank option to the dropdown and then select that blank option: </p>
<p>$(&#8221;#dropdown&#8221;).prepend(&#8221;");<br />
$(&#8221;#dropdown option:first-child&#8221;).attr(&#8221;selected&#8221;,&#8221;selected&#8221;);</p>
<p>But ideally I would prefer not to have a blank option in the dropdown selector so that I dont have to validate the user to ensure they are not submitting a blank value. </p>
<p>What i&#8217;m wondering is if there is a simple way to tell the dropdown to return to the state where nothing is selected, e.g. if there was something like (&#8221;#dropdown&#8221;).reset &#8211; any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ??????? &#187; [Web] ????</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47717</link>
		<dc:creator>??????? &#187; [Web] ????</dc:creator>
		<pubDate>Thu, 16 Jul 2009 06:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47717</guid>
		<description>[...] JQuery: Playing with Select (DropDownList/ComboBox) [...]</description>
		<content:encoded><![CDATA[<p>[...] JQuery: Playing with Select (DropDownList/ComboBox) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47482</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 06 Jul 2009 14:19:27 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47482</guid>
		<description>The reason it&#039;s called &quot;select&quot; instead of a &quot;DropDownList&quot; is a) Microsoft, thankfully, doesn&#039;t get to name things all the time, and b) HTML is supposed to be presentation independent.  Calling it &quot;select&quot; allows the client to display the list of options however they want.  Same reason that &quot;i&quot; and &quot;b&quot; are deprecated in favor of &quot;em&quot; and &quot;strong.&quot;</description>
		<content:encoded><![CDATA[<p>The reason it&#8217;s called &#8220;select&#8221; instead of a &#8220;DropDownList&#8221; is a) Microsoft, thankfully, doesn&#8217;t get to name things all the time, and b) HTML is supposed to be presentation independent.  Calling it &#8220;select&#8221; allows the client to display the list of options however they want.  Same reason that &#8220;i&#8221; and &#8220;b&#8221; are deprecated in favor of &#8220;em&#8221; and &#8220;strong.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Crawford</title>
		<link>http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/comment-page-1/#comment-47415</link>
		<dc:creator>Joe Crawford</dc:creator>
		<pubDate>Thu, 02 Jul 2009 20:13:06 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/#comment-47415</guid>
		<description>Nice tips.

You say &quot;try to avoid using the dom directly&quot; -- why?

Other gotchas of select boxes: select that allows multiple selected options behaves differently.

Also, the val() of an option that does not have a &quot;value&quot; attribute is the the text() string.</description>
		<content:encoded><![CDATA[<p>Nice tips.</p>
<p>You say &#8220;try to avoid using the dom directly&#8221; &#8212; why?</p>
<p>Other gotchas of select boxes: select that allows multiple selected options behaves differently.</p>
<p>Also, the val() of an option that does not have a &#8220;value&#8221; attribute is the the text() string.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
