Vincent van Ruijven
Vincent van Ruijven

Reputation: 175

Active Admin, How can I see if a radio button is selected

f.input :rol, as: :radio, :label => "Rol", :collection => [ 'leerling', 'leraar' ]

So how do I know when one of the radio buttons is selected, because when 'leerling' is selected it needs to show a specific part of the form

Upvotes: 1

Views: 961

Answers (1)

Milind
Milind

Reputation: 5112

jQuery >= 1.6

$("#rol").prop('checked', true);

jQuery < 1.6

    $("#rol").attr('checked', true);

use distinct id or class to check this property

Upvotes: 1

Related Questions