Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created June 4, 2014 17:32
Show Gist options
  • Save jaredatch/21ffeab7362edd3d7f2f to your computer and use it in GitHub Desktop.
Save jaredatch/21ffeab7362edd3d7f2f to your computer and use it in GitHub Desktop.
Gravityforms placeholders
(function($){
$.fn.setPlaceholder = function(){
return this.each(function(){
var label = $(this).parent().prev();
label.hide();
var label = $(this).parent().prev().text().replace('*','');
$(this).attr('placeholder',label);
});
};
})(jQuery);
jQuery(document).ready(function($){
$('.banner-form input[type=text],.banner-form textarea').setPlaceholder();
$(document).bind('gform_post_render', function(){
$('.banner-form input[type=text],.banner-form textarea').setPlaceholder();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment