i have added this customjs JS:
function saveAndSubmit() {
setFieldValue(“Submitted”, true);
dffs_triggerSave(true);
}
function save() {
setFieldValue(“Submitted”, false);
dffs_triggerSave(true);
}
var stage=getFieldValue(“Stage”);
if(stage==”SendToApprover”)
{
document.querySelector(“div[class^=’panelFooterBtnWrap’]”).insertAdjacentHTML(“afterbegin”, “<input type=’button’ value=’Save’ onClick=’save()’>”);
document.querySelector(“div[class^=’panelFooterBtnWrap’]”).insertAdjacentHTML(“afterbegin”, “<input type=’button’ value=’Save and submit’ onClick=’saveAndSubmit()’>”);
}
else if (stage==”Closed”){
}
else
{
document.querySelector(“div[class^=’panelFooterBtnWrap’]”).insertAdjacentHTML(“afterbegin”, “<input type=’button’ value=’Save’ onClick=’save()’>”);
}
Now, i have (save) and (save and submit) buttons, but the problem that when clicking them nothing happens, also i am seeing the following error in the console after clicking on both buttons:
Uncaught ReferenceError: dffs_triggerSave is not defined
at save (<anonymous>:8:3)
at HTMLInputElement.onclick (AllItems.aspx?DFFSID=22&DFFSForm=edit:1:1)
VM26457:3 Uncaught ReferenceError: dffs_triggerSave is not defined
at saveAndSubmit (<anonymous>:3:3)
at HTMLInputElement.onclick (AllItems.aspx?DFFSID=22&DFFSForm=edit:1:1)