简体   繁体   中英

How disable / Enable rechatcha based on uncheck or check from checkbox

I want to disable/enable rechatcha based on uncheck/check from checkbox if unchecked then rechatcha should be disabled; if checked then rechatcha can checklist.

This is my code with checkbox and rechatcha

<input type="checkbox" name="check2" value=""> Saya Menyatakan Bahwa Data   Adalah Benar<br/></h5></B>
<div class="form-group">
 <div  class="col-sm-4">
  <div class="g-recaptcha" nama = "capcay" id ="capcay" data-sitekey="6LfmhHQUAAAAAIhfG-Vhiq4FN1_VPGgARvtlmWsA">
  </div>
 </div>
</div>  

Did'nt test it, but maybe you can use JavaScript to just hide it? document.getElementsById("captcha").setAttribute("style", "display:none;"); (don't forget to also give the ID captcha to the proper element.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM