How to know which button was selected by the end user

Hi All,

Here is a question about interfaces with multiple submit buttons.  I have an approval interface with three submit buttons - Cancel, Re-work, and Proceed.

The user can select any of the buttons to close the form and proceed with the process.  However, I need a way to update a process variable based on which button the user clicked.  Secondly, I would like to make the comment text field required if the user clicks the Cancel or Re-work buttons.

I thought I would add an a!save function in the buttonWidget definitions but it seems SAIL doesn't like that.

How should I do this?

Thanks.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer
    For the first question, as others have said you just need to use the value and saveInto properties of your buttons to save the different values into a rule inputs. As a best practice, these values that you are saving should be constants.

    For your second question, you would just need to mark the required property of your comment field as true and mark the skipValidation property of your Proceed button as true so that only the other two buttons cause the required validation on the comment field to fire.
Reply
  • +1
    Certified Senior Developer
    For the first question, as others have said you just need to use the value and saveInto properties of your buttons to save the different values into a rule inputs. As a best practice, these values that you are saving should be constants.

    For your second question, you would just need to mark the required property of your comment field as true and mark the skipValidation property of your Proceed button as true so that only the other two buttons cause the required validation on the comment field to fire.
Children
No Data