Package org.htmlunit.html

# Interface ValidatableElement

All Known Implementing Classes:
  `HtmlButton`, `HtmlButtonInput`, `HtmlCheckBoxInput`, `HtmlColorInput`, `HtmlDateInput`, `HtmlDateTimeLocalInput`, `HtmlEmailInput`, `HtmlFieldSet`, `HtmlFileInput`, `HtmlHiddenInput`, `HtmlImageInput`, `HtmlInput`, `HtmlMonthInput`, `HtmlNumberInput`, `HtmlObject`, `HtmlOutput`, `HtmlPasswordInput`, `HtmlRadioButtonInput`, `HtmlRangeInput`, `HtmlResetInput`, `HtmlSearchInput`, `HtmlSelect`, `HtmlSelectableTextInput`, `HtmlSubmitInput`, `HtmlTelInput`, `HtmlTextArea`, `HtmlTextInput`, `HtmlTimeInput`, `HtmlUrlInput`, `HtmlWeekInput`

public interface ValidatableElement
An element that supports client side validation based on the Constraint validation API. see https://developer.mozilla.org/en-US/docs/Web/API/Constraint_validation

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default boolean`
  `hasBadInputValidityState()`
  `default boolean`
  `hasPatternMismatchValidityState()`
  `default boolean`
  `hasRangeOverflowValidityState()`
  `default boolean`
  `hasRangeUnderflowValidityState()`
  `default boolean`
  `hasTypeMismatchValidityState()`
  `boolean`
  `isCustomErrorValidityState()`
  `default boolean`
  `isStepMismatchValidityState()`
  `default boolean`
  `isTooLongValidityState()`
  `default boolean`
  `isTooShortValidityState()`
  `boolean`
  `isValidValidityState()`
  `default boolean`
  `isValueMissingValidityState()`
  `void`
  `setCustomValidity(String message)`
  Sets the custom validity message for the element to the specified message.
  `boolean`
  `willValidate()`

- ## Method Details

  - ### willValidate

    boolean willValidate()
    Returns:
      whether the element is a candidate for constraint validation

  - ### setCustomValidity

    void setCustomValidity(String message)
    Sets the custom validity message for the element to the specified message.
    Parameters:
      `message` - the new message

  - ### hasBadInputValidityState

    default boolean hasBadInputValidityState()
    Returns:
      a boolean value boolean value that is true if the user has provided input that the browser is unable to convert.

  - ### isCustomErrorValidityState

    boolean isCustomErrorValidityState()
    Returns:
      a boolean value indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setCustomValidity() method.

  - ### hasPatternMismatchValidityState

    default boolean hasPatternMismatchValidityState()
    Returns:
      true if the value does not match the specified pattern, and false if it does match. If true, the element matches the :invalid CSS pseudo-class

  - ### isStepMismatchValidityState

    default boolean isStepMismatchValidityState()
    Returns:
      true if the value does not fit the rules determined by the step attribute (that is, it's not evenly divisible by the step value), or false if it does fit the step rule. If true, the element matches the :invalid and :out-of-range CSS pseudo-classes.

  - ### isTooLongValidityState

    default boolean isTooLongValidityState()
    Returns:
      true if the value is longer than the maximum length specified by the maxlength attribute, or false if it is shorter than or equal to the maximum. If true, the element matches the :invalid CSS pseudo-class

  - ### isTooShortValidityState

    default boolean isTooShortValidityState()
    Returns:
      true if the value is shorter than the minimum length specified by the minlength attribute, or false if it is greater than or equal to the minimum. If true, the element matches the :invalid CSS pseudo-class

  - ### hasTypeMismatchValidityState

    default boolean hasTypeMismatchValidityState()
    Returns:
      true if the value is not in the required syntax (when type is email or url), or false if the syntax is correct. If true, the element matches the :invalid CSS pseudo-class.

  - ### hasRangeOverflowValidityState

    default boolean hasRangeOverflowValidityState()
    Returns:
      true if the value is greater than the maximum specified by the max attribute, or false if it is less than or equal to the maximum. If true, the element matches the :invalid and :out-of-range CSS pseudo-classes.

  - ### hasRangeUnderflowValidityState

    default boolean hasRangeUnderflowValidityState()
    Returns:
      true if the value is less than the minimum specified by the min attribute, or false if it is greater than or equal to the minimum. If true, the element matches the :invalid and :out-of-range CSS pseudo-classes.

  - ### isValidValidityState

    boolean isValidValidityState()
    Returns:
      true if the element meets all its validation constraints, and is therefore considered to be valid, or false if it fails any constraint. If true, the element matches the :valid CSS pseudo-class; the :invalid CSS pseudo-class otherwise.

  - ### isValueMissingValidityState

    default boolean isValueMissingValidityState()
    Returns:
      true if the element has a required attribute, but no value, or false otherwise. If true, the element matches the :invalid CSS pseudo-class.