Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 05:48 AM - edited 09-10-2024 05:48 AM
@charitha ts You can create an onChange client script on both of your variables and use the following code.
// Get today's date
var today = new Date();
today.setHours(0, 0, 0, 0); // Set time to midnight for accurate comparison
// Parse the selected date
var selectedDate = new Date(newValue);
// Calculate two weeks from today's date
var twoWeeksLater = new Date(today);
twoWeeksLater.setDate(today.getDate() + 14);
// Check if selected date is within two weeks
if (selectedDate >= today && selectedDate <= twoWeeksLater) {
g_form.addInfoMessage('The selected date is within two weeks of today.');
} else {
g_form.clearMessages(); // Clear messages if no longer in the two-week window
}
Update the logic to show message/display exception reason field.
Hope this helps.