Form titles in fields


#1

I only see an option to put form titles above or to the side of the fields

how do i put the form titles in the fields??


#2

Hi, 
you need to hide labels field and Add a Javascript to write labels IN the form fields.
See https://community.unbounce.com/unbounce/topics/field-label-inside-of-field


#3

will i only see the change in preview? I have tried twice and looked in preview and can not see it - i will keep trying


#4

Did you add the JS below ??

Take care : Placeholders names must be the same in your form settings !!
if not, You’ll need to change these to match the fields in your page that you want to give placeholders to. 

lp.jQuery(function($) {  

 // Define your placeholder texts here, corresponding to Unbounce's field names 

 var placeholders = {



"first_name": "First Name",



"last_name": "Last Name",



"email": "Email" 

 }; 

 // Sets the HTML5 placeholders

 for(var id in placeholders){$("#"+id).attr("placeholder",placeholders[id])} 

 // Polyfill to add support for browsers like IE<=9 

 if(document.createElement("input").placeholder===undefined){$("html").attr("data-placeholder-focus","false");$.getScript("//jamesallardice.github.io/Placeholders.js/assets/js/placeholders.jquery.min.js",function(){$(function(){var e=window.module.lp.form.data.validationRules;var t=window.module.lp.form.data.validationMessages;lp.jQuery.validator.addMethod("notEqual",function(e,t,n){return this.optional(t)||$(t).attr("data-placeholder-active")!=="true"||e!==n},function(e,n){return t[$(n).attr("id")].required});for(var n in placeholders){if($("#"+n).length){if(typeof t[n].required!=="undefined"){e[n].notEqual=placeholders[n]}else{e[n]={}}}}})})} });

:point_right: Important Update About Horizontal Forms :point_left:
#5

Thanks, ilane_sephira! This was super helpful.


#6

Is there a way to change the label color? I have other input fields that are #9c9c9c and it is defaulting to the same gray for the labels which I would like a different color to contrast from the field background.

Thanks!