Last active
June 8, 2022 11:55
-
-
Save dantetesta/ad6a8dce3546a59895b432580f72ba1f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="checkbox" class="aceito_os_termos"> | |
| <button class="btn_enviar" type="submit">Submit</button> | |
| <script> | |
| jQuery(document).ready(function(){ | |
| /*DECLARE AS CLASSES DOS CAMPOS ABAIXO*/ | |
| var checkbox_class = '.aceito_os_termos'; | |
| var button_class = '.btn_enviar'; | |
| /*COR DO ESTADO INATIVO DO BOTÃO SUBMIT*/ | |
| var cor_fundo_botao_inativo = '#e5e5e5'; | |
| var cor_fonte_botao_inativo = '#999999'; | |
| /*COR DO ESTADO ATIVO DO BOTÃO SUBMIT*/ | |
| var cor_fundo_botao_ativo = '#333333'; | |
| var cor_fonte_botao_ativo = '#ffffff'; | |
| jQuery(button_class).prop('disabled', true).css('background-color',cor_fundo_botao_inativo).css('color',cor_fonte_botao_inativo); | |
| jQuery(checkbox_class).click(function(){ | |
| if(jQuery(this).is(':checked')){ | |
| jQuery(button_class).prop('disabled', false).css('background-color',cor_fundo_botao_ativo).css('color',cor_fonte_botao_ativo); | |
| } else { | |
| jQuery(button_class).prop('disabled', true).css('background-color',cor_fundo_botao_inativo).css('color',cor_fonte_botao_inativo); | |
| } | |
| }); | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment