Anchor to Form on a Long page

omidhz 17 Jun, 2015
I am using chronoform plugin and publishing my form at the end of a long article. I need to the page to scroll down to the form after submitting the form, either after serverside validation error, thank you message or NoCaptcha error.
I searched the forum and found some codes and hints but I can't make this work.
The one that I'm using is the following code

jQuery(document).ready(function($){
$('html, body').animate({ scrollTop: $('.myformanchor').offset().top }, 'slow');
});


I added a custom code field and defined
class="myformanchor"
at the beginning of the form.

The problem that I'm having is that the page is scrolling to the top of the article, not to the top of the form (which is at the bottom).
Any help is appreciated.
omidhz 18 Jun, 2015
Answer
I was able to fix the problem by using the following code.
jQuery(document).ready(function($){
$('html, body').animate({ scrollTop: $("#myformanchor").offset().top }, 'slow');
});
sortby 23 Jun, 2015
Hello omidhz,
I'm facing similar problem, but not sure how to solve
Could you please check my last post in this topic?
https://www.chronoengine.com/forums/posts/f2/t99852/display-data-after-submit.html

there you can find my questions🙂
I really appreciate your help.

Frank
sortby 24 Jun, 2015
Solved
please refer to this
https://www.chronoengine.com/forums/posts/f2/t99852/display-data-after-submit.html
This topic is locked and no more replies can be posted.