Sha256: b866197e9f40f0ea40f88f22994a9121e34ed7fe657870ce8e9c53b11264acf2
Contents?: true
Size: 616 Bytes
Versions: 53
Compression:
Stored size: 616 Bytes
Contents
$(() => { const $userRegistrationForm = $('.register-form'); const $userGroupFields = $userRegistrationForm.find('.user-group-fields'); const inputSelector = 'input[name="user[sign_up_as]"]'; const setGroupFieldsVisibility = (value) => { if (value === 'user') { $userGroupFields.hide(); } else { $userGroupFields.show(); } } setGroupFieldsVisibility($userRegistrationForm.find(`${inputSelector}:checked`).val()); $userRegistrationForm.on('change', inputSelector, (event) => { const value = event.target.value; setGroupFieldsVisibility(value); }); });
Version data entries
53 entries across 53 versions & 2 rubygems