Created
November 29, 2018 14:03
-
-
Save thiago122/2fc1d362d7617ac4748087fa4f714e1a to your computer and use it in GitHub Desktop.
This file contains 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
$(function(){ | |
var el = $('[data-accept]'); | |
var disableEl = el.attr('data-accept-disable-id') | |
function toggleDisable(){ | |
if ( el.is(':checked') ) { | |
$('#'+disableEl).prop('disabled', false); | |
} else { | |
$('#'+disableEl).prop('disabled', true); | |
} | |
} | |
toggleDisable(); | |
$('body').on('click','[data-accept]', function(){ | |
toggleDisable() | |
}); | |
}) |
This file contains 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="text" data-accept data-accept-disable-id="submit-cadastrar"> Aceitar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment