Item14622: UserRegistration validate.js is not compatible with CaptchaPlugin
Priority: Enhancement
Current State: Closed
Released In: 2.1.6
Target Release: patch
CaptchaPlugin integrates with forms via the jquery.validate functions. jquery.validate does its work when the submit button is pressed. However
TopicUserMappingContrib UserRegistration validate.js script disables the submit button until all individual field validation issues have been resolved. Captcha depends on the Submit action to trigger the captcha check
As the
UserRegistration page also used jquery.validate and the "Register" action will be blocked until all fields are resolved, there is no need to disable the button.
I propose commenting out the disable/enable actions in validate.js. This will allow Captcha integration into registration with a simple form change.
diff --git a/TopicUserMappingContrib/pub/System/UserRegistrationParts/validate.js b/TopicUserMappingContrib/pub/System/UserRegistrationParts/validate.js
index 5de2ffc..175bc3a 100644
--- a/TopicUserMappingContrib/pub/System/UserRegistrationParts/validate.js
+++ b/TopicUserMappingContrib/pub/System/UserRegistrationParts/validate.js
@@ -68,12 +68,12 @@ jQuery(function($) {
// remove generated label
label.remove();
if (validator.numberOfInvalids() === 0) {
- $(':submit').removeClass('foswikiSubmitDisabled');
+ //$(':submit').removeClass('foswikiSubmitDisabled');
$('.expl').addClass('foswikiHidden');
}
},
showErrors: function(errorMap, errorList) {
- $(':submit').addClass('foswikiSubmitDisabled');
+ //$(':submit').addClass('foswikiSubmitDisabled');
$('.expl').removeClass('foswikiHidden');
validator.defaultShowErrors();
}
--
GeorgeClark - 10 Feb 2018