• Resolved timholz

    (@timholz)


    Hi – i integrated the simple math equation (aiowps-captcha-answer) into jquery.validate.js:

    var captcha = $(".aiowps-captcha-answer");
    if(captcha.length !== 0) {
    //changing input type to number for better validation
    captcha.removeProp('type').prop('type', 'number');
    captcha.rules( "add", {
    required: true,
    messages: {
    required: "Ce champs est requis.",
    number: "Chiffres seulment!"
    }
    });
    } else {
    console.log('no captcha');
    }

    This works fine. But when i enter a wrong result, a new tab opens saying: ?Error: You entered an incorrect CAPTCHA answer, please go back and try again.? This is not very user friendly. Is there a way that this message can be integrated as error message just like the ones shown in code above? Regards Theo

    • This topic was modified 3 months, 2 weeks ago by timholz. Reason: wrong spelling
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @timholz,

    The comment captcha is enabled and you have added validation using jQuery browser side it is required.

    Now on submit it validates the answer and if it is incorrect it shows that message you want to change it.

    Or

    Right now on submit it shows that message only. you would like to change that behaviour?

    https://snipboard.io/Zmws5c.jpg

    Regards

    Thread Starter timholz

    (@timholz)

    @hjogiupdraftplus Hi – that’s right. I want to change that behaviour. I want to stay on the comments page and dynamically generate the error message. Is it possible with an ajax call? Thanks for your care. Regards Theo

    p.s.: I forgot to mention that even when the result is incorrect the class ?valid? is added to ?aiowps-captcha-answer?

    • This reply was modified 3 months, 2 weeks ago by timholz. Reason: important
    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @timholz,

    I have created an internal ticket for this behaviour to change if possible

    If you do not want to wait I can send information about the hooks to remove and

    apply your changes with the hook to verify the captcha answer.

    Regards

    Thread Starter timholz

    (@timholz)

    @hjogiupdraftplus Hi – thanks a lot for your answer. Oh, yes, i would appreciate, if you could send me some information about the hook you mentioned. Regards Theo

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @timholz,

    \classes\wp-security-general-init-tasks.php file have this filter adds the captcha validaton

    add_filter('preprocess_comment', array($this, 'process_comment_post'));

    But here the comment is posted wp-comments-post.php and validation for email also shown on blank screen. So it is how the wordpress comment post works.

    Error: Please enter a valid email address.

    https://snipboard.io/GRt8AN.jpg

    So you have to Ajaxify the comment post – I am checking in more detail and get back to you .

    Thread Starter timholz

    (@timholz)

    @hjogiupdraftplus Hi – thanks a lot for your care. For the time being i have rewritten the validation completely and also removed the captcha. But, i am quite interested to hear from you.

    Have an excellent day – theo

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @timholz,

    Ok, I will keep you posted.

    Regards

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @timholz,

    WordPress post comment form validation works that way.

    It shows error message on the next page with backlink.

    We consider not to change that.

    Regards

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.