ckeck if radio button is checked and show error message accordingly
<p>I am not very good at programming, I try to make the following radio buttons:</p>

<pre><code>  &lt;input type="radio" name="yesno1" value="no" style="margin-left:30px;outline:0;"/&gt;No&lt;/div&gt;
          &lt;div id="check1"&gt;*please select&lt;/div&gt;

  &lt;input type="radio" name="yesno2" value="yes" style="outline:0;"/&gt;Yes
          &lt;input type="radio" name="yesno2" value="no" style="margin-left:30px;outline:0;"/&gt;No&lt;/div&gt;
          &lt;div id="check2"&gt;*please select&lt;/div&gt;

   &lt;input type="radio" name="yesno3" value="yes" style="outline:0;"/&gt;Yes
          &lt;input type="radio" name="yesno3" value="no" style="margin-left:30px;outline:0;"/&gt;No&lt;/div&gt;
          &lt;div id="check3"&gt;*please select&lt;/div&gt;

   &lt;input type="radio" name="yesno5" value="yes" style="outline:0;"/&gt;Yes
          &lt;input type="radio" name="yesno5" value="no" style="margin-left:30px;outline:0;"/&gt;No&lt;/div&gt;
          &lt;div id="check5"&gt;*please select&lt;/div&gt;

     &lt;input type="button" value="submit" id="submit"&gt;
</code></pre>

<p>here is my javascript:</p>

<pre><code>    $("#submit").click(function(){
 if (!$("input[name='yesno1']):checked").val()) {
$("#check1").show();
   }

if ($("input[name='yesno1']):checked").val()) {
 $("#check1").hide();
    }
 if (!$("input[name='yesno2']):checked").val()) {
  $("#check2").show();
  }

if ($("input[name='yesno2']):checked").val()) {
   $("#check2").hide();
    }
if (!$("input[name='yesno3']):checked").val()) {
 $("#check3").show();
   }


 if ($("input[name='yesno3']):checked").val()) {
  $("#check3").hide();
     }
 if (!$("input[name='yesno5']):checked").val()) {
   $("#check5").show();
    }

 if ($("input[name='yesno5']):checked").val()) {
  $("#check5").hide();
     }

  });
</code></pre>

<p>I know I am doing a clumsy way, what I want is that, if only one radio button is checked, the other three error messages should show, if two is checked, the other two should show, if three check , the other one should show, if no one checked, all of them show. However only the last case works at the moment, I don't know where I am doing wrong, can any of you help me, thanks in advance.</p>

<p>In addition, I am going to pass the data to the php file, so is it possible if I do:</p>

<pre><code>   $yesno1 = $_POST['yesno1'];
   $yesno2 = $_POST['yesno2'];
   $yesno3 = $_POST['yesno3'];
    $yesno5 = $_POST['yesno5'];
</code></pre>

<p>Thanks for the kind help:)</p>
