Inline form labels with jQuery

Document created by 08b21bd4b65c4441fd72920f489da6afa097beae on Jan 2, 2015Last modified by 9588451ecc601f1a2620c0a3338f73ddec06dbf4 on Jan 20, 2015
Version 3Show Document
  • View in full screen mode

Issue:

 

You want to make the label of the form appear inside the input field.

 

Solution:

 

Use the below code in a custom html block on a landing page with a form:

 

  • remove the current labels in the form editor
  • place the complete code (attached) in a custom html block on the page with the form
  • View the live page to the see the changes


This code uses the field "id" you could use "name" instead.

 

This does not work for "select" fields

Note: Please ensure that you have access to an experienced JavaScript developer.  Marketo Technical Support is not set up to assist with troubleshooting JavaScript.
Please refer to the example and source:

 

http://trevordavis.net/play/jquery-inline-form-labels/

Attachments

    Outcomes