1 function enable_okbutton() {
2 var $div = $('#open_user_agreement');
3 var allchecked = $('input[name="checked[]"]', $div).not(':checked').length == 0;
4 $('input[type=submit]', $div).prop('disabled', !allchecked);
6 $(document).on('click keyup input', '#open_user_agreement input', enable_okbutton);
7 $(document).on('ready ajax:complete', enable_okbutton);