How to reset inputs based on radio button clicked
<p>I have two radio buttons that show parts of a form when clicked as the page is blank when initialised. The parts of the form are located in two different divs. The code below takes care of that very well</p>

<pre><code>$(document).ready(function() {
    $("input[name$='btnyes']").click(function() {
        var test = $(this).val();
        $("div.hidemyforms").hide();
        $("#" + test).show();
        $("div.showsubmit").show();

});
</code></pre>

<p>});</p>

<p><strong>Radio buttons</strong></p>

<pre><code>     &lt;input type="radio" name="btnyes" id="btnyes" value="getmytimeregular" /&gt;Yes
     &lt;input type="radio" name="btnyes" id="btnyes" value="getmytimetaken" /&gt;No
</code></pre>

<p>I'm trying to target the div #getmytimetaken and reset the inputs with the following code when the div #getmytimeregular is visible if the user had selected any previously.</p>

<pre><code>    $("#getmytimetaken").hide().find("input").val("");
</code></pre>

<p>Also if the div #getmytimeregular is visible i need this code not to run as it targets the div #getmytimetaken and ceates errors.</p>

<pre><code>$('.ft4').change(function() {
    var goo = $('.ft4[selectedIndex!=0]').length;
    if (goo &gt;= 1) $('.ft4[selectedIndex=0]').attr('disabled', 'disabled');
    else $('.ft4').removeAttr('disabled');
</code></pre>

<p>});</p>
