Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
After a form is submitted, it scrolls to the success message or first error message. With some themes, this may be underneath a floating header or otherwise misplaced. Use this hook to add extra offset to the scrolling.
Formidable Forms is the best WordPress Form Builder plugin. Get it for free!
Usage
add_filter('frm_scroll_offset', 'frm_scroll_offset');
Parameters
- None
Examples
Offset Autoscroll
add_filter('frm_scroll_offset', 'frm_scroll_offset');
function frm_scroll_offset(){
return 170; //adjust this as needed
}
Disable Autoscroll
add_filter('frm_scroll_offset', 'frm_scroll_offset');
function frm_scroll_offset(){
return -1; //this will disable the autoscroll
}