-
AuthorPosts
-
April 14, 2020 at 6:58 pm #1203719
Hi Support,
I am wanting to move the “message sent” message you get when a form is sent in. What happens now is, when the user submits the form, the “message has been sent” message is above the fold so the user cannot readily see it. I have one customer that wants it to be readily visible. Here is a screenshot of what I am looking for below.
I would like the ability to dial in the placement on the page.
Thank You,
KeithApril 19, 2020 at 5:09 pm #1205280Hey Keith,
Sorry for the late reply, I see that you wanted the message div to move down, but how about scrolling the page up on submit?
Try adding this code to the end of your functions.php file in Appearance > Editor:function custom_script(){ ?> <script> (function($){ $(document).ready(function(){ $("#top.page-id-1167 input.button").click(function() { $("html, body").animate({ scrollTop: 400 }, "slow"); return false; }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
Best regards,
MikeApril 20, 2020 at 4:35 pm #1205516Hi Mike,
I’ll give this a try. Thank you! I appreciate your help!April 20, 2020 at 9:06 pm #1205573Hi,
Did you need additional help on this topic or shall we close?
Best regards,
Jordan ShannonApril 22, 2020 at 12:32 am #1205981Hi Jordan,
I just tried this but it did not work. Added it at the end of the functions.php file in wp-content/themes/enfold
When I hit submit, the form just hung there and did not process.Thanks,
KeithApril 22, 2020 at 12:37 am #1205982Note. Here is the relevant part of the error email I received.
———–Start—————
WordPress version 5.4
Current theme: Enfold (version 4.7.4)
Current plugin: (version )
PHP version 7.3.17Error Details
=============
An error of type E_COMPILE_ERROR was caused in line 807 of the file /var/www/vhosts/awsp.com/httpdocs/wp-content/themes/enfold/functions.php. Error message: Cannot redeclare custom_script() (previously declared in /var/www/vhosts/awsp.com/httpdocs/wp-content/themes/enfold/functions.php:780)April 23, 2020 at 5:06 am #1206421Hi,
Thanks for that, it looks like you have two functions with the same name. Please try this instead:
function khickman_animate_custom_script(){ ?> <script> (function($){ $(document).ready(function(){ $("#top.page-id-1167 input.button").click(function() { $("html, body").animate({ scrollTop: 400 }, "slow"); return false; }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'khickman_animate_custom_script');
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.