• Resolved Robert

    (@kinderrwindstreamnet)


    Excellent progress on the plugin updates! Made a donation to support your work.

    Would it be possible to color the comment form submit button background and text gray when it’s disabled, then restore the default button colors when the captcha is validated?

    Alternatively, an AJAX solution to intercept the submit button click event and display an inline error message if the captcha isn’t validated would be even more user friendly, avoid the need to disable the submit button and the wp_die() error message on a new page.

    Thanks

    https://www.ads-software.com/plugins/wp-recaptcha-integration/

Viewing 1 replies (of 1 total)
  • Plugin Contributor podpirate

    (@podpirate)

    Hi Robert,

    Donation recieved, thank you so much!

    > Would it be possible to color the comment form submit button background and text gray when it’s disabled, then restore the default button colors when the captcha is validated?

    The style of a disabled button is highly depending on Your theme. During testing I noticed that Twentyfifteen already does grays out disabled buttons but twentyfourteen doesn’t.
    A few lines of css can fix this:

    input[type=’submit’][disabled],button[disabled] {
    color:#999;
    background-color:#ccc;
    }

    I just created a gist that integrates it into the WordPress frontend: https://gist.github.com/mcguffin/7cbfb0dab73eb32cb4a2

    1. Click “Download Gist” and unpack the .tar.gz file.
    2. Create a zip archive from the included grey-out-disabled.php
    3. install and activate it like any other plugin.

    > Alternatively, an AJAX solution to intercept the submit button click event and display an inline error message if the captcha isn’t validated would be even more user friendly, avoid the need to disable the submit button and the wp_die() error message on a new page.

    Hmm. A captcha cannot be validated by the Google API more than one time. This is why captcha validation and comment form processing must happen in one turn and during one and the same server request. Splitting captcha validation and comment form processing could open some possible vulnerabilities.
    In v1.0.4 (will be up soon) I added some minor changes to the JS, to make it work together with this plugin (it’s sending comments through ajax):
    https://www.ads-software.com/plugins/wp-ajaxify-comments/

    Happy new year!
    j?rn

Viewing 1 replies (of 1 total)
  • The topic ‘Feature: Gray out Submit button when disabled’ is closed to new replies.