victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
971 stars 475 forks source link

Captcha does not complete validation unless any other form field is clicked. #605

Open webdesgnr14 opened 7 years ago

webdesgnr14 commented 7 years ago

Hello there,

I've been working on a pop up form with bootstrap, my form is currently validating great however, my captcha is not validating unless I click any validated form field again. I'm currently using toggleDisabled so the form cannot be submitted until the class "has-success" is applied to the captcha wrapper. Help!

My jQuery code is below:


//jQuery Validation
    jQuery.validate({
        form : '.request-appt-form',
        modules : 'date, html5, security, toggleDisabled',
        errorMessagePosition : 'inline',
        validateOnBlur : true,
        validateHiddenInputs : true,
        disabledFormFilter : 'form.request-appt-form',
        showErrorDialogs : true,
        reCaptchaSiteKey : '6Lcz2SIUAAAAAJEgs3EkdiCMfwEe83RF3rsdWuQi',
        reCaptchaTheme : 'light',
        reCaptchaSize : 'normal',
    });
webdesgnr14 commented 7 years ago

Anyone?

victorjonsson commented 7 years ago

Do you get the same behaviour if you turn off toggleDisabled

webdesgnr14 commented 7 years ago

No, if i turn off toggleDisable the captcha doesn't have to "validate" to submit the form. The captcha doesn't really validate on blur but it needs to be validated via the server correct? This does not happen unless I write a function to do so correct? without toggleDisabled on?

I'm needing all validation to happen on my modal without refreshing the page then enabling the submit button. How is this possible?

webdesgnr14 commented 7 years ago

Ping!

victorjonsson commented 7 years ago

No, if i turn off toggleDisable the captcha doesn't have to "validate" to submit the form.

The recaptcha input must be valid inorder for the form to complete a submit. But the submit button will always be clickable if you don't use the module toggleDisabled

I'm not sure what you're asking about here. Yes, all validation will take place before the form gets submitted and the page gets refreshed. The case might be that reCaptcha doesn't work together with toggleDisabled. I will look into it.

victorjonsson commented 7 years ago

Here you can see a test http://jsbin.com/qowonaceje/edit?html,console,output that confirms that toggleDisabled is compatiable with recaptcha.

You need to explain, more in detail, what you're trying to achieve and in what way things doesn't work out as expected.

I've found that there's a bug in the latest release. I will try to have it fixed soon.