Skip to main content
May 4, 2022
Question

user interface

  • May 4, 2022
  • 3 replies
  • 0 views

Hi,

I am loading an interface  when a one of the sub action button was clicked and this interface will have 2 dropdowns along with "Submit" and "Cancel" buttons.

I need to validate when user click on "Submit" and should not allow the form to submit when if some of the rule inputs CDT data is missing.

How can I stop submitting the form when user clicks on "Submit" button and also, I have to show the error message by saying "you have missed some of the data fields before performing any option selection".

How can I achieve this. I am missing some kind of trick here.

    3 replies

    Inspiring
    May 4, 2022

    Hi,

    Make the CDT fields which you want to validate are required by passing required as true and In your submit button you have parameter called validate, make this parameter value as true.

    May 4, 2022

    I can do this, If I have to force the user to select these fields.

    But, my question was 

    I should not allow them to select any of these dropdown values only if my rule input of type CDT is not having some specific data values.

    Inspiring
    May 4, 2022

    I am not quit understand your question.

    • If you want to disable you selection options until some CDT filed values are provided, add a condition to disable your selection (using disable parameter) in case if the CDT vales are blank
    • Also, if you want to make this fields only required if some CDT fields are blank and a condition to your required field to only evaluate if CDT fields are blank 

     a!dropdownField(
                      label: "Reviewer",
                      required: a!isNullOrEmpty(ri!cdt.filed1),
                      disabled: a!isNullOrEmpty(ri!cdt.filed1),
                      placeholder: "---Select a Reviewer---",
                      choiceLabels: {"A"},
                      choiceValues: {"A"},
                      value: ri!cdt.filed2,
                      saveInto: ri!cdt.field2
                    )

    • Also if you want to validate only some fields when user try to submit use validation groups. for more information regarding validation groups see here