toggle an input field
<p>i am trying this code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function () {
$('#individual,#company').hide();

$('input[name=radios]:radio:checked').change(function() {
    $('#individual').toggle(this.selectedIndex === 0);
    $('#company').toggle(this.selectedIndex === 1);
});

});
&lt;/script&gt;


&lt;div class="radio-toolbar"&gt;
    &lt;input type="radio"  name="radios"&gt; 
    &lt;input type="radio"  name="radios"&gt; 
&lt;/div&gt;

&lt;div id="x"&gt;
    &lt;form method="post" id="customForm" action=""&gt;
        &lt;div id="individual"&gt;
            &lt;input name="individual" type="text" /&gt;
        &lt;/div&gt;
        &lt;div id="company"&gt; 
            &lt;input name="company" type="text" /&gt;
        &lt;/div&gt;
    &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>basically i want to show only an input field. if i choose the first radio btn, then, i want display the div individual. If i choose the second radio, should be showed the company content.</p>

<p>thanks</p>

<p>demo <a href="http://jsfiddle.net/S5sEv/2/" rel="nofollow">here</a></p>
