I have a Sail form with a confirmation message set on the submit button and mult

I have a Sail form with a confirmation message set on the submit button and multiple required fields, including some set within an applyComponents function. My issue is that if a required field is not completed but the user clicks on the submit button the confirmation message is displayed before the fields are shown in error.
I have added an indicator for one of the fields and added this as a condition to the confirmation message and this works for that one field. Is there any way to check if any required fields are missing without having to put indicators on every required field? What would be the best way to do this?

OriginalPostID-149851

OriginalPostID-149851

  Discussion posts and replies are publicly visible

  • Hi smcgill, a combination of a!buttonWidget() with a "validate" parameter must work. The parameter validate says the button that validate all the required fields on the form and do not submit the form unless they all are filled. Please find the attached snippet code for reference. Hope it helps.

    Sample Code.txt

  • Hi Poornah,
    Thanks for the example.
    Please correct me if I'm wrong but this still requires a indicator to be set for each required field.
    Is there a function to check at a form level if there are any outstanding errors?
    The alternative that I wanted to avoid was to set an error indicator in a with() and update it if any required fields are null and then check that in the confirmMessage.
    BTW I'm currently using a!buttonWidgetSubmit with the skipValidation set to false which I believe is th default
  • 0
    Certified Lead Developer
    Hi McGill,

    One option is you can disable the button if any one of the required field is empty. Enable the button only when all the required fields are not empty.
  • @smcgill Hi, Documentation at https://forum.appian.com/suite/help/7.9/SAIL_Components.html#SubmitButton or https://forum.appian.com/suite/help/7.9/SAIL_Components.html#Button under 'Notes' say that "The SAIL interface only refreshes and the saveInto state change only occurs if the user clicks Yes".

    As far as my understanding is considered, the approaches discussed above also lead you to make usage of the indicators which you are already doing.

    AFAIK there isn't a possibility of detecting the outstanding errors by making use of OOTB functionality. I guess there is no other alternative apart from the one you have chosen. The only thing which we could give a thought about at the moment is, how best (generic in terms of development, less dependency on the other components and effective in terms of execution) we can implement the alternative approach.
  • Thanks for the info.
    I was hoping that there was a behind the scenes array that I could check but I guess it's back to indicators then!