Created
June 19, 2014 21:07
-
-
Save DenisLeblanc/2bdca22e3e4aa9e5cdf0 to your computer and use it in GitHub Desktop.
Placeholder Text in GravityForm Fields
This file contains 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 PLACEHOLDER TEXT IN FORM FIELDS | |
var inner_form_labels = function() { | |
$('.gform_fields input').each(function() { | |
var el = $(this); | |
var placeholder = el.val(); | |
el.attr({ | |
value : null, | |
title : placeholder, | |
placeholder : placeholder | |
}); | |
}); | |
$('.gform_fields textarea').each(function() { | |
var el = $(this); | |
var placeholder = el.val(); | |
el.val(null); | |
el.attr({ | |
title : placeholder, | |
placeholder : placeholder | |
}); | |
}); | |
}; inner_form_labels(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment