Jump to content
Sign in to follow this  
pawprint

jquery to populate my fields

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?

 

Thank you

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...