Jump to content

jquery to populate my fields


pawprint

Recommended Posts

Hello everyone, this is a great site and always pops-up on my search results when I'm trying to alter any code I have on my wordpress site, this next bit what I am trying to achieve is beyond my understanding though.

On my calendar page you select 2 dates, a check-in day and a check-out day, that then brings up another page to input the price per night etc. The box that popsup box does not pre-populate with the minimum days booking or the check-in day (both of these could be answered from the selected days range which prompted the pop-up). 

https://i.imgur.com/j6UmHzP.png


So I would like the drop down menu for "allow bookings starting with the check in on changover days" automatically use the first day in the range (3/2/2020 a monday). And the "minimum days of booking" to automatically populated by using the dates range between the "start date" and "end date".

I believe I need to work with the following areas of my page.

<label for="start_date_owner_book"><?php esc_html_e('Start Date','wprentals');?></label>
<input type="text" id="start_date_owner_book" size="40" name="booking_from_date" class="form-control" value="">

<label for="end_date_owner_book"><?php  esc_html_e('End Date','wprentals');?></label>
<input type="text" id="end_date_owner_book" size="40" name="booking_to_date" class="form-control" value="">

<label for="period_min_days_booking"><?php echo esc_html__( 'Minimum days of booking','wprentals');?></label>
<input type="text" id="period_min_days_booking" size="40" name="period_min_days_booking" class="form-control" value="">

<label for="period_checkin_change_over"><?php echo esc_html__( 'Allow only bookings starting with the check in on changeover days','wprentals');?></label>
<select id="period_checkin_change_over" name="period_checkin_change_over" class="select-submit2">
<?php 
    foreach($week_days as $key=>$value){
        print '   <option value="'.esc_attr($key).'">'.esc_html($value).'</option>';
    }
?>
</select>


Any ideas please? Apologies if this is not the right area.

Thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...