Alert popup (Yes/No) on change of a lookup field

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

09 Jun 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!

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

09 Jun 2017

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:

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
}

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests