How to create a Pop up on a selected variable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2016 08:18 AM
Looking for a Client Script that will Popup a message on a selected variable.. If "No" is selected then a set of instructions will pop up

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2016 08:22 AM
Hi Sean,
Something like this might do it in an onChange client script.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue === '') {
return;
}
if (g_form.getValue('u_field') == 'true') {
confirm("Are you sure?");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 04:54 AM
Hi Chuck,
How would one adjust the script for a date variable, say if the selected date is 7 days less than current date and display a message "your order may not be fulfilled by..."
Kindest Regards,
Mohammed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 06:20 AM
Working with dates on the client script is never any fun (to me anyway.) The Date object has some methods that can help. If I were to dig in to this, I would work with a numeric value of the date (typically in milliseconds) and determine if the difference was 7*84600*1000 (7 days, 86400 is seconds per day, 1000 makes it millseconds) or 604,800,000.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2017 03:46 AM
Thank you for that Chuck, appreciate your advice