Form validation

Hi,

Can I know if it is possible to validate a SAIL form based on the button pressed? The example from SAIL recipe in the documentation, only have an example for 2 buttons using boolean.

Can I do something like for button A, B & C. with value A: 1, B: 2, C: 3. depending on the value, validate accordingly:
If buttonValue = 1, then validate this...
If buttonValue = 2, then validate this...
If buttonValue = 3, then validate this...
else validate that.

Thanks in advance!

OriginalPostID-253442

  Discussion posts and replies are publicly visible

Parents
  • Answered my own question:
    To achieve this, use buttonWidget instead of buttonWidgetSubmit.
    By using buttonWidget, you will be able to save the value of the button into a ri! or local! and then validate the field base on it.
    However, buttonWidgetSubmit is not able to do so, it will submit the form regardless. Making validation based on the value that saved into the local! or ri! not possible.
Reply
  • Answered my own question:
    To achieve this, use buttonWidget instead of buttonWidgetSubmit.
    By using buttonWidget, you will be able to save the value of the button into a ri! or local! and then validate the field base on it.
    However, buttonWidgetSubmit is not able to do so, it will submit the form regardless. Making validation based on the value that saved into the local! or ri! not possible.
Children
No Data