Hi everybody,
I have a form where the user is asked to give a start and an end date.
After giving the start date, the end date should be prepopulated with the start date, whereas this should still be editable.
Cheers,
mai-kel
Try this JS code.
|
Thanks,
Great. That's it! Thanks a lot buddy!
Hi Lakshmi C
I'm new in Nintex. Can you please provide the steps to apply this JS code in Nintex form?
I've tried paste the code in Setting - Form > Custom JavaScript Box
And change the code as below but it doesn't work.
NWF$('#'+VisitStartDateTime).change(function()
{
var date=NWF$('#'+VisitStartDateTime).datepicker('getDate');
NWF$('#'+VisitEndDateTime).datepicker('setDate', date);
});
Thanks,
Emily
Step 1:
Create first date / time control.
Go to advanced settings and configure
- "Store Client ID in JavaScript variable" -> yes
- "Client ID JavaScript variable name" -> Date1
Step 2:
Create (second) date / time control.
Go to advanced settings and configure
- "Store Client ID in JavaScript variable" -> yes
- "Client ID JavaScript variable name" -> Date2
Step3:
Go to form settings.
Open "Advanced", insert the following code into "Custom JavaScript Includes":
NWF$('#'+Date1).change(function()
{
var date=NWF$('#'+Date1).datepicker('getDate');
NWF$('#'+Date2).datepicker('setDate', date);
});
It worked Michael, thanks.
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.