Add placeholder to date field and time field in booking form

I use Experthive and on the listing page, customers can book with selecting the date and time. I’d like to insert a placeholder for the date and the time fields.

I came across the following snippet:

And assumed I might be able to use that code, if I new the name of the form. In the following link it was suggested to find the form name in the hivepress directory /includes/forms but in my theme’s includes directory there are no forms.
https://hivepress.github.io/hook-reference/hivepress_v1_forms_%257Bform_name%257D.html

Could a code snippet be provided for inserting a placeholder for the date and time fields on the listing page?

Thank you in advance!

Hi,

If I understand you correctly, please use these PHP snippets (How to add custom code snippets - HivePress Help Center):

For dates:

add_filter(
	'hivepress/v1/forms/booking_make',
	function( $form ) {
		$form['fields']['_dates']['placeholder'] = 'custom text here';

		return $form;
	},
	1000
);

For time:

add_filter(
	'hivepress/v1/forms/booking_make',
	function( $form ) {
		$form['fields']['_time']['placeholder'] = 'custom text here';

		return $form;
	},
	1000
);

​I hope this is helpful to you.

Yes it was. Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.