Custom JS

Home Forums Classic DFFS Custom JS

Viewing 1 reply thread
  • Author
    Posts
    • #38554
      Wendi Watson
      Participant

        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:
      • #38557
        Alexander Bautz
        Keymaster
      Viewing 1 reply thread
      • You must be logged in to reply to this topic.