23 Mar 2022
in reply to
Missing user
Link to this post
Hello Eric,
Perfect. I do have a sample I can provide to help get you started:
$(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);
});
Drop this into a JavaScript widget on each form where you'd like the timer to exist. Currently as is, after 5 seconds, the script will disable all widgets in the first form on the page as well as the form flow buttons (back and submit).
If you run into any issues with it or have more questions let me know.
Best,
Brady
TPC Web Developer
Last modified on 23 Mar 2022 18:03 by Missing user