Alert popup (Yes/No) on change of a lookup field
- vegard.grutle
- Posts: 59
- Joined: Fri Mar 17, 2017
Hi!
I have a lookup field 'Case Type' which has related fields. Based on the value picked in the dropdown some fields are hided. In addition im running a script which is wiping out values in some fields based on a criteria.
What I want to achieve is an alert pop up when the value in the 'Case Type' field is changed after it has been submitted for the first time. So basically the alert should be triggered only on the edit form.
The alert should say somthing like "Are you sure you want to proseed?" and the user should be able to chose 'Yes' or 'No'.
Is there an easy way to implement this?
Thanks!
I have a lookup field 'Case Type' which has related fields. Based on the value picked in the dropdown some fields are hided. In addition im running a script which is wiping out values in some fields based on a criteria.
What I want to achieve is an alert pop up when the value in the 'Case Type' field is changed after it has been submitted for the first time. So basically the alert should be triggered only on the edit form.
The alert should say somthing like "Are you sure you want to proseed?" and the user should be able to chose 'Yes' or 'No'.
Is there an easy way to implement this?
Thanks!
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
You can save a flag indicating whether a user has already switched the option either in cookie or in a separate field and check if before showing a confirmation dialog:
You can save a flag indicating whether a user has already switched the option either in cookie or in a separate field and check if before showing a confirmation dialog:
Code: Select all
// settings a cookie for the current item:
$.cookie('CaseTypeChanged_' + GetUrlKeyValue('ID'), '1');
// getting a cookie for the current item:
if (!$.cookie('CaseTypeChanged_' + GetUrlKeyValue('ID'))) {
// show a confirmation
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 2 guests