I found a decent solution for this, that also takes care of the confirmation message.
In my functions file I check to see if the for is submitted. Within my logic, I used the wp_footer hook to print a little javascript to scroll down to the bottom of the page, and show the form.
So here is the entirety of my solution, all in the functions file without touching the template:
if ( $_POST[ 'is_submit_1' ] == true ) :
add_action( 'wp_footer', function()
{ ?>
<script>
$('html, body').animate({scrollTop:$(document).height()}, 'slow');
$( '.contact_form' ).toggle( 'slow' );
</script>
<?php }, 99999);
endif;
Posted 12 years ago on Tuesday October 23, 2012 |
Permalink