Skip to content
Advertisement

How to merge two javascript function with third function with condition?

I am beginer in js, and i have problem with merge two fucntions. I want to make third function with condition, when checkbox is marked and reCAPTCHA is marked, only then button is enable. By default, i set the button to disabled. Single functions as below is working:

JavaScript

I tried make someone like this but it doesn’t work:

JavaScript

Advertisement

Answer

Use variables for keeping track of the current status of each condition:

JavaScript

NB: make sure to correct the spelling mistake in your HTML onclick attribute.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement