<?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: How to show/hide divs based on radio button selection using jQuery</title>
	<atom:link href="http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/</link>
	<description>Facebook Apps Dev, WordPress Theme, osCommerce Customization &#38; Flash Development</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:35:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Ali Qureshi</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-1297</link>
		<dc:creator>Ali Qureshi</dc:creator>
		<pubDate>Tue, 29 Nov 2011 05:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-1297</guid>
		<description>The demonstration is above. and here&#039;s the html an css code:

&lt;pre lang=&quot;css&quot;&gt;

#yes_box{

	 border: 1px solid;  

    margin: 10px 0px;  

    padding:5px 5px 5px 5px;  

    background-repeat: no-repeat;  

    background-position: 10px center;

	   width:300px;

color: black;   

background-color:#B9DBE1;    
	}

#no_box{

	 border: 1px solid;  

    margin: 10px 0px;  

    padding:5px 5px 5px 5px;  

	  width:300px;

color: black;   

background-color: #FEADAB;    
	}

&lt;/pre&gt;



&lt;pre lang=&quot;html&quot;&gt;

&lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;form1&quot;&gt;
  &lt;p&gt;
    &lt;label&gt;

      &lt;input type=&quot;radio&quot; name=&quot;group_name&quot; value=&quot;Yes&quot; id=&quot;group_name_0&quot; /&gt;

      Yes&lt;/label&gt;

    &lt;label&gt;

      &lt;input type=&quot;radio&quot; name=&quot;group_name&quot; value=&quot;No&quot; id=&quot;group_name_1&quot; /&gt;

    No&lt;/label&gt;

    &lt;br /&gt;

  &lt;/p&gt;

&lt;/form&gt;

&lt;div id=&quot;yes_box&quot;&gt;

This is you Yes box content. Now select the &#039;No&#039; radio button and this box will disappear slowly and No content box will appear!

&lt;/div&gt;



&lt;div id=&quot;no_box&quot;&gt;

This is you No box content. Now select the &#039;Yes&#039; radio button and this box will disappear slowly and Yes content box will appear!

&lt;/div&gt;

&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>The demonstration is above. and here&#8217;s the html an css code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&nbsp;
<span style="color: #cc00cc;">#yes_box</span><span style="color: #00AA00;">&#123;</span>
&nbsp;
	 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>  
&nbsp;
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>  
&nbsp;
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>  
&nbsp;
    <span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>  
&nbsp;
    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
&nbsp;
	   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>   
&nbsp;
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#B9DBE1</span><span style="color: #00AA00;">;</span>    
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#no_box</span><span style="color: #00AA00;">&#123;</span>
&nbsp;
	 <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>  
&nbsp;
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>  
&nbsp;
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>  
&nbsp;
	  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>   
&nbsp;
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FEADAB</span><span style="color: #00AA00;">;</span>    
	<span style="color: #00AA00;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;form1&quot;&gt;
  &lt;p&gt;
    &lt;label&gt;
&nbsp;
      &lt;input type=&quot;radio&quot; name=&quot;group_name&quot; value=&quot;Yes&quot; id=&quot;group_name_0&quot; /&gt;
&nbsp;
      Yes&lt;/label&gt;
&nbsp;
    &lt;label&gt;
&nbsp;
      &lt;input type=&quot;radio&quot; name=&quot;group_name&quot; value=&quot;No&quot; id=&quot;group_name_1&quot; /&gt;
&nbsp;
    No&lt;/label&gt;
&nbsp;
    &lt;br /&gt;
&nbsp;
  &lt;/p&gt;
&nbsp;
&lt;/form&gt;
&nbsp;
&lt;div id=&quot;yes_box&quot;&gt;
&nbsp;
This is you Yes box content. Now select the 'No' radio button and this box will disappear slowly and No content box will appear!
&nbsp;
&lt;/div&gt;
&nbsp;
&nbsp;
&nbsp;
&lt;div id=&quot;no_box&quot;&gt;
&nbsp;
This is you No box content. Now select the 'Yes' radio button and this box will disappear slowly and Yes content box will appear!
&nbsp;
&lt;/div&gt;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: nabil</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-1296</link>
		<dc:creator>nabil</dc:creator>
		<pubDate>Tue, 29 Nov 2011 02:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-1296</guid>
		<description>Where&#039;s the div code? how to display each div? Please need help, i dont really get the idea.

TY</description>
		<content:encoded><![CDATA[<p>Where&#8217;s the div code? how to display each div? Please need help, i dont really get the idea.</p>
<p>TY</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aviator</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-1144</link>
		<dc:creator>aviator</dc:creator>
		<pubDate>Thu, 27 Oct 2011 00:05:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-1144</guid>
		<description>thank you so much.</description>
		<content:encoded><![CDATA[<p>thank you so much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali Qureshi</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-903</link>
		<dc:creator>Ali Qureshi</dc:creator>
		<pubDate>Fri, 12 Aug 2011 06:48:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-903</guid>
		<description>Check it &lt;a href=&quot;http://www.parorrey.com/wp-content/uploads/2010/06/radio-buttons.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;here &lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Check it <a href="http://www.parorrey.com/wp-content/uploads/2010/06/radio-buttons.html" target="_blank" rel="nofollow">here </a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mick</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-901</link>
		<dc:creator>mick</dc:creator>
		<pubDate>Thu, 11 Aug 2011 18:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-901</guid>
		<description>where is a demo ?</description>
		<content:encoded><![CDATA[<p>where is a demo ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali Qureshi</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-861</link>
		<dc:creator>Ali Qureshi</dc:creator>
		<pubDate>Thu, 21 Jul 2011 05:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-861</guid>
		<description>I&#039;ve placed the code in code tag, it appears now. Thanks for posting!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve placed the code in code tag, it appears now. Thanks for posting!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pato</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-860</link>
		<dc:creator>Pato</dc:creator>
		<pubDate>Thu, 21 Jul 2011 05:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-860</guid>
		<description>damn the comments hide code!</description>
		<content:encoded><![CDATA[<p>damn the comments hide code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pato</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-859</link>
		<dc:creator>Pato</dc:creator>
		<pubDate>Thu, 21 Jul 2011 05:28:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-859</guid>
		<description>This works thanks! I tried using js but failed miserably. I am new to JQuery and I managed to decipher this, it took some time to get my head around it so I have added a few things I needed to work out for amateurs like me... 

1) Make sure you are linking to a JQuery library in your header ie.
 

2)  &#039;group_name&#039; is the name of the list of radio buttons ie.

&lt;pre lang=&quot;javascript&quot;&gt;
$(&quot;input[name$=&#039;group_name&#039;]&quot;)
&lt;/pre&gt;


3 ) 
&lt;pre lang=&quot;javascript&quot;&gt;

if(radio_value==&#039;Yes&#039;).

&lt;/pre&gt;

&#039;radio_value&#039; is the value of the radio button ie.


4)
&lt;pre lang=&quot;javascript&quot;&gt;

$(&quot;#yes_box&quot;).hide();...

&lt;/pre&gt;

&#039;yes_box&#039; refers to the &#039;id&#039; of your ,, or anything that you can give an &#039;id&#039; to ie.
Anything within this table will hide</description>
		<content:encoded><![CDATA[<p>This works thanks! I tried using js but failed miserably. I am new to JQuery and I managed to decipher this, it took some time to get my head around it so I have added a few things I needed to work out for amateurs like me&#8230; </p>
<p>1) Make sure you are linking to a JQuery library in your header ie.</p>
<p>2)  &#8216;group_name&#8217; is the name of the list of radio buttons ie.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[name$='group_name']&quot;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>3 )</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>radio_value<span style="color: #339933;">==</span><span style="color: #3366CC;">'Yes'</span><span style="color: #009900;">&#41;</span>.</pre></div></div>

<p>&#8216;radio_value&#8217; is the value of the radio button ie.</p>
<p>4)</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#yes_box&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>...</pre></div></div>

<p>&#8216;yes_box&#8217; refers to the &#8216;id&#8217; of your ,, or anything that you can give an &#8216;id&#8217; to ie.<br />
Anything within this table will hide</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.parorrey.com/blog/php-development/how-to-showhide-divs-based-on-radio-button-selection-using-jquery/comment-page-1/#comment-405</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 17 Dec 2010 01:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.parorrey.com/blog/?p=113#comment-405</guid>
		<description>Thank you, I was looking for something else, but this gave me idea for what I needed.</description>
		<content:encoded><![CDATA[<p>Thank you, I was looking for something else, but this gave me idea for what I needed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

