Skip to main content
July 25, 2022
Solved

Save button should get enabled if changes are made to initial submission

  • July 25, 2022
  • 18 replies
  • 0 views

Under the form, I have a save button that will be disabled after the form submission. The button should be enabled if any changes are made to the data or a comment is added.Any help will be appreciated.

    Best answer by stefanhelzle0001

    I recommend to not implement one huge form covering all use cases. This becomes complex and hard to maintain.

    But, to answer your question, add a local variable "isModified" and default it to false. Then add a a!save() to all fields to update isModified to true(). Then use that status to add some logic to the submit button.

    Now, check my first sentence ...

    18 replies

    stefanhelzle0001
    Brainy
    July 25, 2022

    I recommend to not implement one huge form covering all use cases. This becomes complex and hard to maintain.

    But, to answer your question, add a local variable "isModified" and default it to false. Then add a a!save() to all fields to update isModified to true(). Then use that status to add some logic to the submit button.

    Now, check my first sentence ...

    July 25, 2022

    do u have any example to quote?

    mikes0011
    Brainy
    July 25, 2022

    A simplified example:

    a!textField(
      label: "my data",
      value: ri!textField1Value,
      saveInto: {
        ri!textField1Value,
        a!save(
          local!isModified,
          true()
        )
      }
    )

    The Expression Guru
    mikes0011
    Brainy
    July 25, 2022

    For what it's worth, this could have just been a new comment in your existing thread on the same subject.  The problem with arbitrarily staring brand new threads is that people seeing it for the first time won't be able to review the past comments and any context they may provide.

    The Expression Guru