Ok thanks,
Here is what ive done.
In functions.php i added the code to load a custom js file:
<?php
function my_scripts_method() {
wp_enqueue_script(
'custom-script',
get_template_directory_uri() . '/js/custom_script.js',
array( 'jquery' )
);
}
add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
?>
This works and actually loads the js file in my theme.
Then in my theme folder i uploaded the custom_script.js file with the code:
$(document).on('submit', '.em-booking-form', function(e){
if($("#booking_terms").prop('checked') == false){
//do something
alert("is not checked");
});
However the alert is not displayed when i try to submit the booking form and uncheck the checkbox. But when i add the above code (of my custom js file) in the file events-manager/includes/js/bookingsform.js the check/alert is working (so i guess the custom script is not called by the bookings form?). However i don’t want to edit that file because the custom coding will get overwritten when i do an update of the plugin.
So why is the check only working when added in the bookingsform.js file? And is there a way to validate the checkbox through jquery, by a custom made js file? Maybe by using an action hook?
Thanks again!