Eric Mann
59 posts
Registered:
16 Oct 2020
14 Dec 2023
in reply to
Mike Cohen
Link to this post
Mike,
We use this type of JavaScript for timeout then we add in whatever action based on that tmeout such as redirect, alert message, or disable fields.
$(document).on("tpc:ready", function (event, tpcObject) {
const myTimeout = setTimeout(function () {
// Loop through widgets in first form on page and disable
for (widget in tpc.forms[0].$$instance.get_formWidgets()) {
try {
tpc.forms[0].$$instance.get_formWidgets()[widget].disable();
} catch {}
}
// Disable buttons
$(".tpc-formflow-buttons").children(".btn").prop("disabled", true);
// Clear the timeout (to prevent re-running)
clearTimeout(myTimeout);
}, 5000);
});
- Eric