One of the most common requests I receive as a WordPress developer is to make it so that a simple form field value clears when a user clicks or focuses on a given field.  Since I use Gravity Forms for just about ever form I create, I would like to provide the following code, which was provided via the Gravity Forms forums:


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();

});

Note that you will need to add the “clearit” class to each form field via the Gravity Forms back end.