Home › Forums › Classic DFFS › Custom JS
- This topic has 1 reply, 2 voices, and was last updated 1 day, 4 hours ago by
Alexander Bautz.
-
AuthorPosts
-
-
April 14, 2025 at 18:08 #38554
Hello Alexander
I am hoping you can help me here. I am trying to launch a Custom JS script but it is not working. When I view the console here is the message I see
VM153:9 Uncaught ReferenceError: setFieldDisabled is not defined
at toggleFieldToDisable (<anonymous>:9:9)
at <anonymous>:14:1
at b (jQuery.js?v=1744295668044:2:866)
at He (jQuery.js?v=1744295668044:2:48648)
at E.fn.init.append (jQuery.js?v=1744295668044:2:49999)
at Object.loadCustomJS (eval at <anonymous> (DFFS_frontend_min.js:10:1), <anonymous>:1:202332)
at Object.loadDependencies (eval at <anonymous> (DFFS_frontend_min.js:10:1), <anonymous>:1:204183)
at HTMLDocument.eval (eval at <anonymous> (DFFS_frontend_min.js:10:1), <anonymous>:1:176726)
at e (jQuery.js?v=1744295668044:2:30310)
at t (jQuery.js?v=1744295668044:2:30612)and here is the JS I am trying to use
function toggleFieldToDisable() {
var f1 = getFieldValue(“Control_x0020_Certified_x003f_”);
var f2 = getFieldValue(“Checklist_x0020_Certified_x003f_”);
var f3 = getFieldValue(“Checker_x0020_Inventory_x0020_Ce”);if (f1 === “Yes” && f2 === “Yes” && f3 === “Yes”) {
setFieldDisabled(“Requesting_x0020_an_x0020_Except”, true);
} else {
setFieldDisabled(“Requesting_x0020_an_x0020_Except”, false);
}
}// Call it immediately on form load
toggleFieldToDisable();// Set up watchers so it also runs when these fields change
spjs.dffs.doReadOnlyOnChange.push({fin:”Control_x0020_Certified_x003f_”, functionName:toggleFieldToDisable});
spjs.dffs.doReadOnlyOnChange.push({fin:”Checklist_x0020_Certified_x003f_”, functionName:toggleFieldToDisable});
spjs.dffs.doReadOnlyOnChange.push({fin:”Checker_x0020_Inventory_x0020_Ce”, functionName:toggleFieldToDisable});setFieldDisabled(“Requesting_x0020_an_x0020_Except”, true);
I am not able to understand where I need to change the file location for JS and wondering if you can help me?
Attachments:
-
April 14, 2025 at 20:16 #38557
I replied to your question here: https://spjsblog.com/forums/topic/v4-4-5-55-has-been-released/#post-38556
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.