Nintex for SharePoint Forum
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
I used the below line to check
(window.location.href.toLowerCase().indexOf("mode=1")>0)?NWF$("input.user").val():NWF$("div.user").text()
mode=1 is for edit mode and mode=2 is for display mode
I can confirm that this method works. (Nintex 2016 / SharePoint 2016 On-Premises)
NWF.FormFiller.Events.RegisterAfterReady(function () {
if ({Common:IsNewMode}) {
alert('New Mode');
}
});
Thanks for this confirmation
One caveat: if you are not embedding custom JS but instead linking to a JS file on the server in your form's Custom JavaScript Includes, then these functions will not work automatically. I am assuming that the ({Common:______}) reference is translated into a real function by something in the NWF library, but it's not obvious what would do this.
Thanks for the details
Hi there,
I get an erorr while debugging JS:
SCRIPT5009: 'IsNewMode' is undefined
The start of the JS is simple:
NWF$(document).ready(function () { if ({Common:IsNewMode}) { GetUser(); } ...
How come?!
Nintex F. 2013 (Version: 2.11.3.10)
You can detect the form mode in JavaScript using the following syntax:
':IsNewMode' ':IsEditMode' ':IsDisplayMode'
For example:
if ':IsNewMode' {
alert('Form is in New mode');
} if ':IsEditMode' {
alert('Form is in Edit mode');
}
if ':IsDisplayMode' {
alert('Form is in Display mode');
}