- Issue created by @Krilo_89
When using MTCaptcha on multistep forms, it will display on every step. But when filled in correctly, you don't want to display it on other steps.
Create multistep form with webform module and add mtcaptca to it. You will see the mtcaptcha form on multiple steps, even after filling one in correctly.
Use the 'checktoken' api to check if the token is still valid. I don't know how long a token is valid, but they say a few minutes. This is enough to fill in a form I think. See the spec for the api:
CHECKTOKEN API
URL: https://service.mtcaptcha.com/mtcv1/api/checktoken
HTTP METHOD: GET
Parameters:
privatekey : The shared PrivateKey secret between your server and MTCaptcha. (Required)
token : The VerifiedToken string. (Required)
eg:
https://service.mtcaptcha.com/mtcv1/api/checktoken?privatekey=<your_privatekey>&token=<verified-token>
This means that we need to save the verified-token for a couple of minutes. Because the mtcaptcha form is rendered through ajax, the verified token in the form always changes on pageloads of ajax refreshes. Therefore saving the token in the temp storage is the only way to prevent multiple mtcaptchas in one form.
Active
6.1
Code