简体   繁体   中英

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

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

那么我怎么知道何时选择了一个单选按钮,因为当选择'leerling'时它需要显示表单的特定部分

jQuery >= 1.6

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

jQuery < 1.6

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

use distinct id or class to check this property

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM