Check a textarea to fill?

On the website using reCAPTCHA from Google. She loaded iframe-ohms. There is an empty textarea and a hidden field in which the text appears after the reCAPTCHA was successful. The point is that as soon as this text box shows the text, you need to remove the disabled attribute from the submit button of the form.
Do this check:
if ($("#g-recaptcha-response").val(")) {
 alert("Value is empty");
} else {
 alert("NOT empty");
}

I get a message saying that field is empty. How to make so that this condition was checked continuously until, until it will not appear in the text?
July 8th 19 at 11:34
1 answer
July 8th 19 at 11:36
$("#g-recaptcha-response").change(function(){
if ($("#g-recaptcha-response").val() == " ) { //check val for void
 alert("Value is empty");
} else {
 alert("NOT empty");
}
});

and assign a change event or keypress
The first thing that happens when the page loads it checks it, and writes that "NOT empty". Further, it does not validate. - holly.Howe commented on July 8th 19 at 11:39
It should probably cycle to run, but I'm not good at this, so please help. - holly.Howe commented on July 8th 19 at 11:42
you just need the correct event to choose for the textarea. I think change is best suited - abigail_Lesch commented on July 8th 19 at 11:45
if I understand correctly, the change will take effect only in the case when the user changes something on the form. And then the user of this field does not see, accordingly, this event is not suitable - holly.Howe commented on July 8th 19 at 11:48
No change no keypress is not working - holly.Howe commented on July 8th 19 at 11:51
if I'm not mistaken the captcha from Google to return true or false, to be able to activate the submit button, so bind to the condition of activation of the submit button click the appearance or hide the message about the empty field and the text in the textarea is easier than to assign events or cycles.
What specifically is hard to say without a live example - abigail_Lesch commented on July 8th 19 at 11:54
: Can tell how to do it? - holly.Howe commented on July 8th 19 at 11:57

Find more questions by tags jQueryHTML