I was trying to make the "name field" & "phone field" in the events booking form a required field as well and I managed to look for some answers from here --> https://wordpress.org/support/topic/booking-form-required-fields?replies=13. Have also added the below codes into my child theme functions.php. On the single event page (with the booking form), after clicking on the "Send your booking" (without entering anything into the fields), error message still shows only "ERROR: Please type your e-mail address." only. Is there any steps I'm missing here? Have anyone experience the same issue before and could anyone point me in the right direction?
function em_validate($result, $EM_Event){
if (!is_user_logged_in() && $_REQUEST['user_name'] == ''){
$EM_Event->add_error('Your Name is Required...');
$result = false;
}
if (!is_user_logged_in() && $_REQUEST['dbem_phone'] == ''){
$EM_Event->add_error('Your Contact Number is Required...');
$result = false;
}
if (!is_user_logged_in() && $_REQUEST['user_email'] == ''){
$EM_Event->add_error('Your Email is Required...');
$result = false;
}
return $result;
}
add_filter('em_event_validate','em_validate', 1, 2);