Let's say I have 2 date input objects:
Date From: ______
Date To: ______
I would like to achieve the following: As soon as a date has been picked from the popup calendar of the Date From field, the calendar of the Date To will show up.
Example: I pick 2019-12-01 and the calendar of the "Date to" field would appear with the initial date of the "Date From" picker.
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
open next calendar
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: open next calendar
Hi:
Add some custom JS in the "Date From" field (onchange event):
This should open the popup calendar of the "Date To" Field (Untested!)
Add some custom JS in the "Date From" field (onchange event):
This should open the popup calendar of the "Date To" Field (Untested!)
Code: Select all
var df = $('#dateFrom').val(); nuPopupCalendar($('#dateTo')[0], df);
You do not have the required permissions to view the files attached to this post.
Re: open next calendar
Toms, this does not work for me. Nothing happens after picking a date from the 1st calendar. Do you have a clue as to why that is so?
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: open next calendar
Here's the trick. use setTimout() to make it workTimo wrote:Toms, this does not work for me. Nothing happens after picking a date from the 1st calendar. Do you have a clue as to why that is so?
Code: Select all
var df = $('#dateFrom').val(); if(df !== '') { setTimeout(function() { $('#dateTo').focus(); nuPopupCalendar($('#dateTo')[0], df); }, 100);}