asked on December 11
Hope somebody can help me with the modern forms designer on a self hosted setup.
I have a client running on Laserfiche Forms Professional Version 12.0.2503.10378 where I use "DOMContentLoaded" in the JS to get a token from the URL to be used on the form.
// Get the review uuid (token) from the URL and set it into the Manager Review UUID field
document.addEventListener("DOMContentLoaded", function () {
const url = new URL(window.location.href);
let token = new URLSearchParams(url.search).get("token");
console.log("Extracted token:", token);
if (token) {
token = token.trim();
setTimeout(function () {
// Target by variable name (preferred for Modern Designer)
const field = document.querySelector("[data-var='Manager_Review_UUID'] input");
if (field) {
field.value = token;
// Dispatch input event so Forms registers the change
field.dispatchEvent(new Event("input", { bubbles: true }));
console.log("Manager Review UUID field set with token.");
} else {
console.warn("Manager Review UUID field not found. Check variable name or selector.");
}
}, 2000); // 2000 ms = 2 seconds
} else {
console.log("Token is empty or not provided.");
}
});
This code works perfectly in this version of forms, however in the latest version "Laserfiche Forms Professional Version 12.0.2509.20409" on a separate customer's server, the code does not seem to be executing.
1
0