Ah … of course ??
If anyone else is interested, this is what I did:
CSS
.wccpf_fields_table.inscription-wrapper {
display: none;
}
jQuery
jQuery('.wccpf-field').click(function() {
jQuery('.wccpf_fields_table.inscription-wrapper')[this.checked ? "show" : "hide"]();
});
Note: .inscription-wrapper
is the name of my input field that is not visible until the checkbox is clicked.
Note: I added the above jQuery to a JS file (tweaks.js) that I added to WordPress via my child theme’s functions.php using the enqueue method:
/* Enqueue Scripts */
function my_scripts_method() {
wp_enqueue_script('tweaks', get_stylesheet_directory_uri() .'/assets/tweaks.js', array('jquery'), '1.0', false);
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
-
This reply was modified 7 years, 1 month ago by
trishahdee.