Skip to main content
thenmozhim
January 19, 2024
Question

Why validation of dropdown field is triggered even though the field value is null?

  • January 19, 2024
  • 9 replies
  • 0 views

a!localVariables(
  local!singleDropDownValue,
  local!multipleDropDownValue,
  {
    a!dropdownField(
      label: "Single Dropdown",
      placeholder: "Select",
      choiceLabels: { "Jane", "Jack" },
      choiceValues: { 1, 2 },
      value: local!singleDropDownValue,
      saveInto: { local!singleDropDownValue },
      validations: "Error..."
    ),
    a!multipleDropdownField(
      label: "Multiple Dropdown",
      placeholder: "Select",
      labelPosition: "ABOVE",
      choiceLabels: { "Jane", "Jack" },
      choiceValues: { 1, 2 },
      value: local!multipleDropDownValue,
      saveInto: { local!multipleDropDownValue },
      validations: "Error..."
    ),
    a!buttonLayout(
      primaryButtons: a!buttonWidget(label: "submit", submit: true)
    )
  }
)

Expecting validation to trigger only when the field value is not null. It works for multiple dropdown, but why not for dropdown?

    9 replies

    harshitb6843
    January 19, 2024

    Why there isn't any condition for the validation property and instead it just has a text?

    Required validations are triggered when you submit the form whereas the validation added via 'validations' property of a field triggers instantly.

    amaans4178
    January 19, 2024

    but it is triggering instantly (without any save action) for dropdown field only not for multiple dropdown, what it can be ?