JQuery Radio

Radio Button with good visual


 

       

Enable - Disable - Check (Radio B) - Uncheck

 

       

Enable - Disable - Check (Radio D) - Check (Radio F) - Uncheck

 

Using selector jquery for all radio buttons

Enable All - Disable All - Check All - Uncheck All

 

Create

$('input:radio').radio();

// with options
$('input:radio').radio({
       callback: function()
       {
               alert('ID: ' + $(this).attr('id'));
       }
});

Enable

$('input:radio').radio('enable');

Disable

$('input:radio').radio('disable');

Check

$('input:radio').radio('on');

Uncheck

$('input:radio').radio('off');

 

Rules

- Do not include a parent type "label" for the radio element, Instead, use the attribute "for"
- It's not possible to check all radio buttons! You need to specify just the element ID for the function "on"!
  » E.g: $("#id").radio("on");