Skip to content

Message Plugin

Displays validation error messages in the DOM next to each field.

Options

OptionTypeDefaultDescription
containerstringundefinedCSS selector for a single container to display all messages. Without this, a <div> is inserted after each field.
clazzstring"vd-plugins-message-container"CSS class applied to each message container element
firstbooleanfalseWhen true, only the first error message is shown per field

Playground

Notes

  • Without container, a <div class="vd-plugins-message-container"> is inserted immediately after each validated field element.
  • With container: '#errors', per-field message divs are inserted inside that container instead of after each field element.
  • On uninstall() (e.g., fv.destroy()), all injected message elements are removed from the DOM.
  • Use first: true to show only the first error message per field (similar to Sequence, but at the display layer — all validators still run).

Released under the MIT License.