• Resolved imstanleyyeo

    (@imstanleyyeo)


    First of all thank you for this amazing plugin!

    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://www.ads-software.com/support/topic/booking-form-required-fields?replies=13. Have also added the below codes into my child theme functions.php. On the event page (with the booking form), after clicking on the “Send your booking”, error message still shows only “ERROR: Please type your e-mail address.”. Is there any steps I’m missing here? Could anyone point in the right direction? Btw, I’m using the free version as I do not required payment features in the pro version.

    Thanks a lot and very much appreciate your time and help.

    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);

    https://www.ads-software.com/plugins/events-manager/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter imstanleyyeo

    (@imstanleyyeo)

    Hi, Is there anyone who came across this issue and can help here? Thanks so much

    Hi,

    Do you have an email field in your form?

    Thread Starter imstanleyyeo

    (@imstanleyyeo)

    Hi caimin_nwl,

    Yes I’m using the standard booking form which include the four fields – [Name], [phone], [email], [comments]. Out of these only the [email] field is a required field.

    As I am not managing users who book the event in wordpress – with disabled registation (No-user booking mode), I would like to make the [name] field and [phone] field to be a required field as well so that I would know how to contact them when they book an event. Look forward to your advise.

    Thread Starter imstanleyyeo

    (@imstanleyyeo)

    Is there anything else I am missing here besides this piece of code in my theme’s functions.php? By the way I have commented out the comments in the booking-fields.php in mytheme/plugins/events-manager/forms/bookingform/ (copied form plugins/events-manger folder) as I do not require this field. Supposedly it won’t affect the required fields for the booking form right?

    Thread Starter imstanleyyeo

    (@imstanleyyeo)

    Hi caimin_nwl / Marcus,

    Hope you can advise and help me. Many thanks for your time.

    Can you post a live link to your site?

    Thread Starter imstanleyyeo

    (@imstanleyyeo)

    I manage to get the answers from this post –> https://www.ads-software.com/support/topic/change-required-fields-in-registration-form?replies=3

    Instead of using ’em_event_validate’
    add_filter('em_event_validate','em_validate', 1, 2);

    should be using ’em_booking_validate’ in the filter hook
    add_filter('em_booking_validate','em_validate', 1, 2);

    Thanks a lot for your time anyway, cheers.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Events Manager booking form required fields’ is closed to new replies.