summaryrefslogtreecommitdiff
path: root/modules/user/user.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/user.js')
-rw-r--r--modules/user/user.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/user/user.js b/modules/user/user.js
index 50bb84981..14302621d 100644
--- a/modules/user/user.js
+++ b/modules/user/user.js
@@ -173,4 +173,25 @@ Drupal.evaluatePasswordStrength = function (password, translate) {
};
+/**
+ * Field instance settings screen: force the 'Display on registration form'
+ * checkbox checked whenever 'Required' is checked.
+ */
+Drupal.behaviors.fieldUserRegistration = {
+ attach: function (context, settings) {
+ var $checkbox = $('form#field-ui-field-edit-form input#edit-instance-settings-user-register-form');
+
+ if ($checkbox.size()) {
+ $('input#edit-instance-required', context).once('user-register-form-checkbox', function () {
+ $(this).bind('change', function (e) {
+ if ($(this).attr('checked')) {
+ $checkbox.attr('checked', true);
+ }
+ });
+ });
+
+ }
+ }
+};
+
})(jQuery);