<?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: Creating Custom Form Elements Using jQuery: Selects</title>
	<atom:link href="http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/feed/" rel="self" type="application/rss+xml" />
	<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/</link>
	<description>A resource for Web designers and developers to read about and discuss their craft.</description>
	<lastBuildDate>Fri, 03 Sep 2010 12:40:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: [jQuery] 自訂 select 選單樣式 &#171; Partner Studio</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-25961</link>
		<dc:creator>[jQuery] 自訂 select 選單樣式 &#171; Partner Studio</dc:creator>
		<pubDate>Wed, 18 Aug 2010 06:35:19 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-25961</guid>
		<description>[...] 解法： http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/ [...]</description>
		<content:encoded><![CDATA[<p>[...] 解法： <a href="http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/" rel="nofollow">http://mondaybynoon.com/2009/0.....y-selects/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willem</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-25195</link>
		<dc:creator>Willem</dc:creator>
		<pubDate>Thu, 08 Jul 2010 14:28:45 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-25195</guid>
		<description>First of all: great job!! Saved me alot of time ;-)
But there is one bug when selecting/clicking an option. I think Jonathan Christopher already said it but in the code you let jquery search for classname &quot;index&quot; and get the text() from it, problem is that there is no text() there and the search should go for class &quot;value&quot; so it can match. The selectboxes work fine, but once submitted you get empty values.


here is my solution to it (a little sloppy code sorry):

// set the proper index
var t = $(this).find(&#039;span.value&#039;).text();
for (var i = 0; i &lt; realselect[0].options.length; i++) {
	if (realselect[0].options[i].innerHTML == t) {
		realselect[0].selectedIndex = i;
	}
}
//the above code is to replace this line:
//realselect[0].selectedIndex = $(this).find(&#039;span.value&#039;).text();</description>
		<content:encoded><![CDATA[<p>First of all: great job!! Saved me alot of time ;-)<br />
But there is one bug when selecting/clicking an option. I think Jonathan Christopher already said it but in the code you let jquery search for classname &#8220;index&#8221; and get the text() from it, problem is that there is no text() there and the search should go for class &#8220;value&#8221; so it can match. The selectboxes work fine, but once submitted you get empty values.</p>
<p>here is my solution to it (a little sloppy code sorry):</p>
<p>// set the proper index<br />
var t = $(this).find(&#8216;span.value&#8217;).text();<br />
for (var i = 0; i &lt; realselect[0].options.length; i++) {<br />
	if (realselect[0].options[i].innerHTML == t) {<br />
		realselect[0].selectedIndex = i;<br />
	}<br />
}<br />
//the above code is to replace this line:<br />
//realselect[0].selectedIndex = $(this).find(&#039;span.value&#039;).text();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jQuery: customizando um select &#124; Bruno Macaco</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-12722</link>
		<dc:creator>jQuery: customizando um select &#124; Bruno Macaco</dc:creator>
		<pubDate>Thu, 13 Aug 2009 01:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-12722</guid>
		<description>[...] ver todo o desenvolvimento da solução basta acessar o post. Já o resultado final pode ser conferido [...]</description>
		<content:encoded><![CDATA[<p>[...] ver todo o desenvolvimento da solução basta acessar o post. Já o resultado final pode ser conferido [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Christopher</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-12656</link>
		<dc:creator>Jonathan Christopher</dc:creator>
		<pubDate>Tue, 11 Aug 2009 12:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-12656</guid>
		<description>Hi Connor, first, thanks for the compliment! Great idea posting here instead of an email, I&#039;m sure other people will find the answer useful.

To achieve the result you&#039;re looking for, you&#039;ll need to play a bit with &lt;a href=&quot;http://www.w3schools.com/HTMLDOM/prop_select_selectedindex.asp&quot; rel=&quot;nofollow&quot;&gt;selectedIndex&lt;/a&gt;. You&#039;ll need to set up a conditional for each index you&#039;d like to hook with an appearing input box. The way you&#039;d hook it would be via the &lt;a href=&quot;http://docs.jquery.com/Events/change&quot; rel=&quot;nofollow&quot;&gt;change event&lt;/a&gt; in jQuery. The pseudocode would look something like this:

On mySelect.change
Check to see if the new selectedIndex equals x (where x is the index you&#039;re looking for)
If selectedIndex does equal x, show the input, if not, hide it

Does that help a bit to get started?</description>
		<content:encoded><![CDATA[<p>Hi Connor, first, thanks for the compliment! Great idea posting here instead of an email, I&#8217;m sure other people will find the answer useful.</p>
<p>To achieve the result you&#8217;re looking for, you&#8217;ll need to play a bit with <a href="http://www.w3schools.com/HTMLDOM/prop_select_selectedindex.asp" rel="nofollow">selectedIndex</a>. You&#8217;ll need to set up a conditional for each index you&#8217;d like to hook with an appearing input box. The way you&#8217;d hook it would be via the <a href="http://docs.jquery.com/Events/change" rel="nofollow">change event</a> in jQuery. The pseudocode would look something like this:</p>
<p>On mySelect.change<br />
Check to see if the new selectedIndex equals x (where x is the index you&#8217;re looking for)<br />
If selectedIndex does equal x, show the input, if not, hide it</p>
<p>Does that help a bit to get started?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Connor</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-12581</link>
		<dc:creator>Connor</dc:creator>
		<pubDate>Sun, 09 Aug 2009 21:50:23 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-12581</guid>
		<description>Hi Jonathan,

First of all, I&#039;m a big fan of MBN. I really enjoy reading everything you have to say.

I do have one question, though... I was going to email it, but I figured others were probably wondering the same thing.

Is there a way to make it so if the user selected a certain option, let&#039;s say option two, to have an input box slide out from under it, asking them for one more piece of information? Essentially, a conditional input field, but with options instead of radio or checkboxes? I haven&#039;t found anything that deals with them, and I would really appreciate it if you could help me out!

Thanks so much!</description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>First of all, I&#8217;m a big fan of MBN. I really enjoy reading everything you have to say.</p>
<p>I do have one question, though&#8230; I was going to email it, but I figured others were probably wondering the same thing.</p>
<p>Is there a way to make it so if the user selected a certain option, let&#8217;s say option two, to have an input box slide out from under it, asking them for one more piece of information? Essentially, a conditional input field, but with options instead of radio or checkboxes? I haven&#8217;t found anything that deals with them, and I would really appreciate it if you could help me out!</p>
<p>Thanks so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grahambell</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-9178</link>
		<dc:creator>grahambell</dc:creator>
		<pubDate>Wed, 06 May 2009 06:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-9178</guid>
		<description>good
&gt;&gt; $(this).parent().parent().parent().parent().parent().parent();
better ?
&gt;&gt; $(this).parents(&quot;.classname&quot;) .eq(0)</description>
		<content:encoded><![CDATA[<p>good<br />
&gt;&gt; $(this).parent().parent().parent().parent().parent().parent();<br />
better ?<br />
&gt;&gt; $(this).parents(&#8220;.classname&#8221;) .eq(0)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Couple of Quick Tips for JavaScript Optimization - Monday By Noon</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-8796</link>
		<dc:creator>A Couple of Quick Tips for JavaScript Optimization - Monday By Noon</dc:creator>
		<pubDate>Mon, 27 Apr 2009 13:51:43 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-8796</guid>
		<description>[...] this in mind came in very handy as I was working with creating custom selects via jQuery. Essentially what I needed to do was loop through an existing select and duplicate each option [...]</description>
		<content:encoded><![CDATA[<p>[...] this in mind came in very handy as I was working with creating custom selects via jQuery. Essentially what I needed to do was loop through an existing select and duplicate each option [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe Stemberger</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-6330</link>
		<dc:creator>Christophe Stemberger</dc:creator>
		<pubDate>Fri, 06 Mar 2009 08:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-6330</guid>
		<description>Hi there!
I found your solution really helpfull, especially since its also enabled for IE6!

The only 2 problems / remarks i have are :

- on page load,  - the options div is shown by default.
i can hide this y setting it CSS to display none - but im not sure if thats okay?

- also, when selecting an option in the dropdown, it is not shown into the box... i can see the dropdown with the options, but when i click one, the upper field just stays empty...



any help on these???

thanks alot!</description>
		<content:encoded><![CDATA[<p>Hi there!<br />
I found your solution really helpfull, especially since its also enabled for IE6!</p>
<p>The only 2 problems / remarks i have are :</p>
<p>- on page load,  &#8211; the options div is shown by default.<br />
i can hide this y setting it CSS to display none &#8211; but im not sure if thats okay?</p>
<p>- also, when selecting an option in the dropdown, it is not shown into the box&#8230; i can see the dropdown with the options, but when i click one, the upper field just stays empty&#8230;</p>
<p>any help on these???</p>
<p>thanks alot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Christopher</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-6052</link>
		<dc:creator>Jonathan Christopher</dc:creator>
		<pubDate>Wed, 25 Feb 2009 16:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-6052</guid>
		<description>Thanks for the feedback, everyone!

@Daniel Laughland: You&#039;re absolutely correct. In fact, that&#039;s what I&#039;m currently working on as this project progresses. I&#039;ll be sure to include an outline of keyboard support as that becomes available. I&#039;m also considering releasing the example as a plugin once other form elements are taken care of. Thanks very much for bringing that up, as I&#039;m surprised to have left it out of the article itself!</description>
		<content:encoded><![CDATA[<p>Thanks for the feedback, everyone!</p>
<p>@Daniel Laughland: You&#8217;re absolutely correct. In fact, that&#8217;s what I&#8217;m currently working on as this project progresses. I&#8217;ll be sure to include an outline of keyboard support as that becomes available. I&#8217;m also considering releasing the example as a plugin once other form elements are taken care of. Thanks very much for bringing that up, as I&#8217;m surprised to have left it out of the article itself!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-02-24 &#124; This Inspires Me</title>
		<link>http://mondaybynoon.com/2009/02/23/creating-custom-form-elements-using-jquery-selects/#comment-6015</link>
		<dc:creator>links for 2009-02-24 &#124; This Inspires Me</dc:creator>
		<pubDate>Tue, 24 Feb 2009 10:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://mondaybynoon.com/?p=385#comment-6015</guid>
		<description>[...] Creating Custom Form Elements Using jQuery: Selects (tags: jquery javascript forms) [...]</description>
		<content:encoded><![CDATA[<p>[...] Creating Custom Form Elements Using jQuery: Selects (tags: jquery javascript forms) [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 2/11 queries in 0.007 seconds using disk

Served from: mondaybynoon.com @ 2010-09-06 11:25:01 -->