Hi @asiry
I hope you are doing well.
Unfortunately, it is not possible, maybe to improve the user experience you can use the pagination: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#page-break
Best Regards
Patrick Freitas
Hi @asiry
Here’s a quick and dirty javascript solution that does the trick.
Add this javascript to any pages with the form:
<script>
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
const boxes = document.querySelectorAll('input');
boxes.forEach(box => {
box.addEventListener('click', function handleClick(event) {
delay(500).then(() => window.scrollBy(0, 250, 'smooth'));
});
});
</script>
And add this CSS to any pages with the form (or sitewide):
html {
scroll-behavior: smooth;
}
Here’s how it looks in action: http://recordit.co/v0fD41z2l7.gif
Hope this helped
Thread Starter
asiry
(@asiry)
Dear @aakash8
I added the code, but it doesn’t work.
Can you check if I did it right? (https://caretix.nl/gezondheidstest/)
@wpmudevsupport12 Thank you for your fast response.
@asiry
I’m seeing an error that the const/variable boxes is already being used elsewhere on you site. Try this instead:
<script>
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
const forminator_boxes = document.querySelectorAll('input');
forminator_boxes.forEach(box => {
box.addEventListener('click', function handleClick(event) {
delay(500).then(() => window.scrollBy(0, 250, 'smooth'));
});
});
</script>
Thread Starter
asiry
(@asiry)
@aakash8
I am grateful for your time. Thank you.
It is still not working.
@asiry
No problem.
The error is gone now, I think we just need to run the script after page load now.
Try:
<script>
window.onload = function () {
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
const forminator_boxes = document.querySelectorAll('input');
forminator_boxes.forEach(box => {
box.addEventListener('click', function handleClick(event) {
delay(500).then(() => window.scrollBy(0, 250, 'smooth'));
});
});
};
</script>
Have to sign off for now, hopefully this does the trick! Otherwise someone will get back to you. Good luck.