Hello,
Although I am using SharePoint Online Forms, I am trying to configure a task list which is in classic mode. I am trying to change all fields to read only for one particular form based on sharepoint group. Code seems to work when I change to 100% however if I change back to 50% and save it changes back to 100%. I am not sure what I am doing wrong. Goal is to have all fields set to read only when percentage is 100% . Want to do based on Percent complete not status. My code is pasted in javascript above.
My Code:
function setPercentComplete() {
if (fd.field('PercentComplete').value('100')) {
// Setting the Percent Complete to 100
fd.field('Status').value() == 'Completed'
// Getting JQuery-object of the field and disable it
fd.field('Title').readonly(true);
} else {
// Getting JQuery-object of the field and enable it
fd.field('Title').readonly(false);
}
}
// Calling setPercentComplete when the user changes the status
fd.field('PercentComplete').change(setPercentComplete);
// Calling setPercentComplete on form loading
setPercentComplete();
// Enabling fields before the submission
fd.onsubmit(function () {
fd.field('Title').readonly(false);
return true;
});