Always show datepicker

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #768818
    Tony
    Participant

    I want to make the datepicker calendar always be visible when using the [mphb_availability_search ] shortcode.
    Instead of having to click the check-in and check-out fields to have the calendar pop-out, I want have the datepicker calendar to be pinned and always be visible under each field.

    Any ideas on how I can make it show this way?

    #769473
    J. Davis
    Keymaster

    Hello Tony,

    Unfortunately there is no option to make date-pick popups active by default. Moreover if you make date-picker active for both fields with vertical alignment then one of them will overlap the other one.

    Could you specify the reason why you need those fields to be active by default?

    best regards,
    J. Davis

    #769918
    Tony
    Participant

    Thanks for the reply, even though I didn’t get the response I was hoping for.

    The reason is that my client wants it shown that way, but if its not possible then we will have to make it work like it is.

    #770263
    Stacy Lind
    Keymaster

    Hi Tony,

    The calendars can be displayed at all times if you change the input field to a div. E.g. for forms added with [mphb_availability_search] edit \wp-content\plugins\motopress-hotel-booking\templates\shortcodes\search\search-form.php
    Change lines 33-43:

    <input
    			id="<?php echo esc_attr( 'mphb_check_in_date-' . $uniqid ); ?>"
    			data-datepick-group="<?php echo esc_attr( $uniqid ); ?>"
    			value="<?php echo esc_attr( $checkInDate ); ?>"
    			placeholder="<?php _e( 'Check-in Date', 'motopress-hotel-booking' ); ?>"
    			required="required"
    			type="text"
    			name="mphb_check_in_date"
    			class="mphb-datepick"
    			autocomplete="off"
    			/>

    to a div:

    <div
    			id="<?php echo esc_attr( 'mphb_check_in_date-' . $uniqid ); ?>"
    			data-datepick-group="<?php echo esc_attr( $uniqid ); ?>"
    			value="<?php echo esc_attr( $checkInDate ); ?>"
    			placeholder="<?php _e( 'Check-in Date', 'motopress-hotel-booking' ); ?>"
    			required="required"
    			type="text"
    			name="mphb_check_in_date"
    			class="mphb-datepick"
    			autocomplete="off">
    			</div>

    This will display the check-in date-picker instead of the input field. It may require additional styling, too.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.