I have a form built with RSForm pro on my website home page and when user submit that, it redirects them to a second form (booking form) and auto populate the fields selected on first form. Im wondering how I could scroll up the screen if user accessed the second form trough home page form.
I found this JS in RsForm documentations but it's for multipage form.
<script>
function rsfp_showPage(thePage) {
RSFormProUtils.removeClass(thePage, 'formHidden');
window.scrollTo(0, findPos(document.getElementById('userForm')));
}
function findPos(obj) {
var curtop = 0;
if (obj.offsetParent) {
do {
curtop += obj.offsetTop;
} while (obj = obj.offsetParent);
return [curtop];
}
}
thanks in advance