NewForm Edit

Home Forums General discussion NewForm Edit

Viewing 1 reply thread
  • Author
    Posts
    • #31183
      Chris
      Participant

        Hi, I’m looking to set up a new form and I want to make it so that the submitter can not enter their name in a people picker field. I’d like to have a dialog box pop up and hide the save button. i added a rule to do this on change of the field and compare it to the submitter but it isn’t working. Also, is there an easy way to prevent users who have updated an item from going back in to change items

        Thanks.

      • #31194
        Alexander Bautz
        Keymaster

          To prevent selecting your own user you can set up a rule triggering on change of the people picker. Set the operator to is equal to and This value to {currentUser}. Scroll down to Set field value and select the people picker and leave the Value empty. Add a message in the “Alert this message” textbox to tell the user he cannot select himself.

          To prevent editing the same record you already edited you can add this to your EditForm Custom JS:

          if(String(spjs.dffs.beforeProperties.Editor_ID[0]) === String(_spPageContextInfo.userId)){
              jQuery("#part1").css("visibility", "hidden");
              spjs.dffs.alert({
                  "title": "No access",
                  "msg": "You cannot edit a list item that you have already edited.",
                  "ok": function(){
                      jQuery("input[id$='_diidIOGoBack']:first").trigger("click");            
                  }
              });
          }

          Please note that this only checks the last person that edited the item. If you first create the item and try to open it again it will prevent you from editing, but if someone else does edit it in the meantime you are allowed to edit.

          Alexander

      Viewing 1 reply thread
      • You must be logged in to reply to this topic.