Last active
October 12, 2015 00:17
-
-
Save jeffsebring/3941807 to your computer and use it in GitHub Desktop.
Hidden Gravity Forms Validation & Confirmation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the wp_enqueue_scripts hook to enqueue scripts and styles | |
add_action( 'wp_enqueue_scripts', 'mytheme_enqueue', 99999); | |
# Callback function | |
function mytheme_enqueue() | |
{ | |
wp_enqueue_script( 'mytheme', get_stylesheet_directory_uri() . '/javascripts/theme.js', array( 'jquery' ), '', 'footer' ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Was this form submitted? | |
if ( isset( $_POST[ 'is_submit_1' ] ) ) : | |
# Print our javascript in the footer. | |
add_action( 'wp_footer', function() | |
{ ?> | |
<script> | |
jQuery(document).ready(function() { | |
$( '.contact_form' ).toggle( 0 ); | |
$('html, body').animate({scrollTop:$(document).height()}, 0); | |
}); | |
</script> | |
<?php }, 99999); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment