Created
September 8, 2018 14:17
-
-
Save pbrocks/47267d441b36c98036d80388fa21a47f to your computer and use it in GitHub Desktop.
Add hidden PMPro registration field that shows a message when a checkbox is ticked.
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
jQuery(document).ready(function($) { | |
var label = $('label[for=hidden_check]'); | |
$(label).hide(); | |
$('#date_check').click(function() { | |
if($('#date_check').is(':checked')) { | |
$(label).css('color','salmon').show(); | |
$('input[name=hidden_check]').val('1'); | |
} else { | |
$(label).hide(); | |
$('input[name=hidden_check]').val('0'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment