Gravity Forms Logging
File is located in
TF gflogging_example.php: include this file to log Gravity Forms notices and errors to debug.log (Note: newer versions of GF may have this better integrated.
prevent page scrolling on submit
- // prevents page scrolling on both form submission and moving between pages in ajax mode
- // old way add_filter("gform_confirmation_anchor", create_function("","return false;"));
- add_filter( 'gform_confirmation_anchor', '__return_false' );
// prevents page scrolling on both form submission and moving between pages in ajax mode
// old way add_filter("gform_confirmation_anchor", create_function("","return false;"));
add_filter( 'gform_confirmation_anchor', '__return_false' );Custom AJAX Spinners
- add_filter( 'gform_ajax_spinner_url', 'custom_gforms_spinner' );
- function custom_gforms_spinner( $src ) {
- // note: there is a set of spinner choices in /images
- // make more at http://www.ajaxload.info
- // example of different spinners on different pages
- if($_SERVER["REQUEST_URI"] == "/")
- return get_stylesheet_directory_uri() . '/images/ajax-spinner-white-on-blue.gif';
- else
- return get_stylesheet_directory_uri() . '/images/ajax-spinner-blue.gif';
- }
add_filter( 'gform_ajax_spinner_url', 'custom_gforms_spinner' );
function custom_gforms_spinner( $src ) {
// note: there is a set of spinner choices in /images
// make more at http://www.ajaxload.info
// example of different spinners on different pages
if($_SERVER["REQUEST_URI"] == "/")
return get_stylesheet_directory_uri() . '/images/ajax-spinner-white-on-blue.gif';
else
return get_stylesheet_directory_uri() . '/images/ajax-spinner-blue.gif';
}Available Spinners
make more at http://www.ajaxload.info
images/ajax-spinner-white-on-blue.gif

images/ajax-spinner-white-on-red.gif

images/ajax-spinner-red.gif

images/ajax-spinner-blue.gif

Clear Input Box on Focus
- // clears input box on focus in gravity form
- jQuery(document).ready(function() {
- jQuery.fn.cleardefault = function() {
- return this.focus(function() {
- if( this.value == this.defaultValue ) {
- this.value = "";
- }
- }).blur(function() {
- if( !this.value.length ) {
- this.value = this.defaultValue;
- }
- });
- };
- jQuery(".clearit input, .clearit textarea").cleardefault();
- });
// clears input box on focus in gravity form
jQuery(document).ready(function() {
jQuery.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
}
});
};
jQuery(".clearit input, .clearit textarea").cleardefault();
});

