Adobe Marketo Engage Logo
  • Community
    • Discussions
    • Ideas
    • Community Blogs
    • Marketo User Groups (MUGs)
  • Support
    • Case Management
    • Knowledgebase
    • Product Documentation
    • Developer Portal
  • University
    • Way to Learn
    • Get Certified
    • Learning Paths
    • Marketo University Support
Sign In
  • Marketing Nation
  • :
  • Support
  • :
  • Knowledgebase
  • :
  • Adding a Label Above Form Fields

Adding a Label Above Form Fields

Article Options
  • Article History
  • Subscribe to RSS Feed
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content

Adding a Label Above Form Fields

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Use sample if you want to place a label above a group of form fields. Here's an example of the result:

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

In that example, if you wanted to add the label above the "First Name" and "Company Name" fields, you need to first get the IDs of those fields.

After you have the ID(s), change the highlighted code below to those IDs. You can then change the style or text in the label by editing the HTML in the "before()" function.

<script type="text/javascript" src="/js/public/jquery-latest.min.js"></script>
<script type="text/javascript">
  $jQ = jQuery.noConflict();
  $jQ(document).ready(function(){
    $jQ("#FirstName").parent().parent().before("<div style='padding-bottom:20px;font-weight:bold;'>Personal Info</div>");
    $jQ("#Company").parent().parent().before("<div style='padding-bottom:20px;font-weight:bold;'>Company Info</div>");
  });
</script>



Download Attachments:

Label above form fields-JS.txt

Contributors
  • Jamie-Carey
    Jamie-Carey
Tags (3)
  • custom code
  • design studio
  • forms
No ratings
0 Likes
Was this article helpful? Yes No
542
Adobe Marketo Engage Footer Logo
  • Legal
  • Privacy
  • Cookies
  • Trust.Marketo.com
Home