-1

I have code

$options = array('hours' => 'Hours', 'km' => 'Km', 'unit' =>"Unit");
                            $attributes = array('legend' => false);
echo $this->Form->radio('unit_type', $options, $attributes);

Now I would like to check which radio button is checked in javascript. I used

$("input[name='data[Equipment][unit_type]']:checked").val();

but it's not working.

empiric
  • 7,825
  • 7
  • 37
  • 48
sabin
  • 841
  • 12
  • 15

1 Answers1

0

Try This

$("input[name='data[Equipment][unit_type]']").is(":checked");

tarikul05
  • 1,843
  • 1
  • 16
  • 24