Quantcast
Channel: Topliners: Message List
Viewing all articles
Browse latest Browse all 3431

Re: forms placeholder attribute

$
0
0

I've been looking for an answer to this too, but i haven't had any luck. This is what i did. I added the 'name' attribute to all my input fields where i want to add a placeholder, since we are using forms from eloqua this attribute will be set by default; change the content of the attribute with whatever you want to have as placeholder. Example <input type="text" name="firstname" /> changes to <input type="text" name="First Name"/>

 

Once you have all your attr set, add this call on your js tools (you find this under "Tools")

 

$('input[type="text"]').each(function() {

  var placeholder = $(this).attr('name');

 

  $(this).attr('placeholder', placeholder);

 

});

 

this will create all the place holders for your inputs. if you want you can be more specific and doing them individually with this code:

 

$('input#INPUT-ID').attrr('placeholder', 'Your place holder text');

 

I hope this helps, good luck!


Viewing all articles
Browse latest Browse all 3431

Trending Articles