validate radio button not working jquery

How to perform validation radiobutton. failed to perform the radio button validation when use button type button instead input type submit.

Demo : http://jsfiddle.net/05qm3r4m/63/

Answers 1

  • Try this:

    $(document).ready(function() {
        $('#myform').validate({
        rules:{
            foobar : 
          {
            required: true
          }
        }
      });
    });
    

    Updated Fiddle

    There are so many issue with your code.

    • You have to give similar name for all the radio resides in one group, otherwise they work like checkbox.
    • Jquery validation works on name for the specific element. So name is mandatory.

    Updated Fiddle with custom message


Related Articles