Conditional Logic Error

@DryChips,

There are no syntax errors in the code, that's all I can say.

Try commenting out all code except this one:

fd.spRendered(function() {
    if(fd.field('Is_x0020_the_x0020_employee_x0020').value == 'No' 
&& fd.field('Is_x0020_the_x0020_Employee_x002').value == 'No'){
        
            //display the alert box
            alert("You can't edit this form");
            var listId = fd.spFormCtx.ListAttributes.Id;
            var itemId = fd.itemId;

            //redirect to Display form
            window.location.href = _spPageContextInfo.webAbsoluteUrl + "/_layouts/15/listform.aspx?PageType=4&ListId=" + listId + "&ID=" + itemId;

    }
});

You can also debug the code, find the instructions here:

1 Like