Mode-Detection: New Form, Edit Form

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Post Reply
UDRO
Posts: 22
Joined: Mon Sep 21, 2020

01 Nov 2021

Hello,

how can I detect in the Javascript-Code if a form is opened as “New Form” or as “Edit Form”. We know that It is possible to save “New Form” and “Edit Form” with differing Javascript-Code, but this is easily overwritten when all options are accidently set while saving the form.

Regards UDRO

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

02 Nov 2021

Dear UDRO,
You can check it like this:

Code: Select all

if(fd._formType() == 'New'){
  //new form code
}
else if(fd._formType() == 'Edit'){
  //edit form code
}
Cheers

UDRO
Posts: 22
Joined: Mon Sep 21, 2020

05 Nov 2021

Thank you, that's the code we have been looking for.

Regards, UDRO

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest