New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Item14622: UserRegistration validate.js is not compatible with CaptchaPlugin

Priority: Enhancement
Current State: Closed
Released In: 2.1.6
Target Release: patch
Applies To: Extension
Component: CaptchaPlugin, TopicUserMappingContrib
Branches: master Item14288 Release02x01
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
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
                if (validator.numberOfInvalids() === 0) {
-                   $(':submit').removeClass('foswikiSubmitDisabled');
+                   //$(':submit').removeClass('foswikiSubmitDisabled');
            showErrors: function(errorMap, errorList) {
-               $(':submit').addClass('foswikiSubmitDisabled');
+               //$(':submit').addClass('foswikiSubmitDisabled');

-- GeorgeClark - 10 Feb 2018

Topic revision: r6 - 02 Mar 2018, GeorgeClark - This page was cached on 21 Mar 2018 - 06:58.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License