In this tutorial, we look at how to change the lable and placeholder on form elements.

Labels and placeholders on primary fields

USP Pro has “primary” form fields and “custom” form fields. Primary fields are any field that has its own quicktag and shortcode, for example:

  • [usp_name]
  • [usp_url]
  • [usp_title]
  • [usp_captcha]
  • [usp_tags]
  • [usp_category]
  • [usp_taxonomy]
  • [usp_content]
  • [usp_files]

For any of these fields, you can change the placeholder (i.e., the text that is displayed in the form field on the front-end) and label (i.e., the text that is displayed in the <label> tag) as follows:

  • Label text: to the shortcode, add label="Label"
  • Placeholder: to the shortcode, add placeholder="Placeholder"

Of course, you’ll want to change the “Label” and “Placeholder” with whatever makes sense.

Labels and placeholders on custom fields

To change label and placeholder text for custom fields, just add the following attribute to the custom field definition:

  • label#Label
  • placeholder#Placeholder

When adding an attribute to a custom field, use a vertical pipe | as a separator, and a pound sign # to distinguish between the attribute name and attribute value. Here is an example:

attribute_name#attribute_value|another_attribute_name#another_attribute_value

Resources