1. Component Guide
  2. Select
  3. With error id but no message
Select example

With error id but no message

For some selects the error message should be rendered separately but an error state is still required (currently required in smart answers). In this scenario an error_id can be passed without an error_message to highlight the component and set aria-describedby correctly.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/select", {
  id: "dropdown4-2",
  label: "What lunch option would you like?",
  error_id: "error_id",
  options: [
      text: "",
      value: ""
      text: "Vegetarian",
      value: "option1"
      text: "Meat",
      value: "option2"
} %>