on submit not working as planned
Posted: 15 Jan 2021
Hi I have a form that has two sign off fields in the form. each sign of field will have two gros in the people picker
Users will will only belong to one group.
The problem I'm getting is that when a user signs there part off it does not save as I think the form is looking for a value in the other people picker
Example
a user checking the techSO clicks the checkbox and their name and date will appear correctly. However when saving the form it does not save.
If I make the prodcmptby and prodsodate readonly true in the properties the user is able to save . However, I cant do this as I need them to be visible and usable.
is there a way I can check one of the check boxes and be able to save the form without having changed the other group?
Users will will only belong to one group.
The problem I'm getting is that when a user signs there part off it does not save as I think the form is looking for a value in the other people picker
Example
a user checking the techSO clicks the checkbox and their name and date will appear correctly. However when saving the form it does not save.
If I make the prodcmptby and prodsodate readonly true in the properties the user is able to save . However, I cant do this as I need them to be visible and usable.
is there a way I can check one of the check boxes and be able to save the form without having changed the other group?
Code: Select all
fd.field('Prodcmpltby').readonly(true);
fd.field('prodsodate').readonly(true);
fd.field('Techcmpltby').readonly(true);
fd.field('techsodate').readonly(true);
fd.field('ProdSO').change(function(){
fd.field('Prodcmpltby').readonly(false);
fd.field('prodsodate').readonly(false);
if(fd.field('ProdSO').value()){
fd.field('Prodcmpltby').value(_spPageContextInfo.userLoginName);
fd.field('prodsodate').value(new Date());
}
else{
fd.field('Prodcmpltby').value(null);
fd.field('prodsodate').value(null);
}
fd.field('Prodcmpltby').readonly(true);
fd.field('prodsodate').readonly(true);
});
fd.field('TechSo').change(function(){
fd.field('Techcmpltby').readonly(false);
fd.field('techsodate').readonly(false);
if(fd.field('TechSo').value()){
fd.field('Techcmpltby').value(_spPageContextInfo.userLoginName);
fd.field('techsodate').value(new Date());
}
else{
fd.field('Techcmpltby').value(null);
fd.field('techsodate').value(null);
}
fd.field('Techcmpltby').readonly(true);
fd.field('techsodate').readonly(true);
});
fd.onsubmit(function () {
fd.field('prodsodate').readonly(false);
fd.field('Prodcmpltby').readonly(false);
fd.field('Techcmpltby').readonly(false);
fd.field('techsodate').readonly(false);
return true;
});