Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#815961
Hello
Is there any way to check if a variable assigned to a text box has changed since the beginning of dynaform and the output of dynaform?

Example:
When dynaform starts there are two text boxes associated with two distinct variables, if i change the value of one of the text boxes, I need to know the value changed to save the new value in the database when i submit the form.

Thank you
#815962
Create two triggers. The first trigger will save the original value of the variable:
Code: Select all
@@field1Original = @@field1;
Then, create a second trigger to test whether it has changed:
Code: Select all
if (@@field1Original != @@field1) {
    @@field2 = "changed";
}
Set the first trigger to execute before the Dynaform and the second to execute after the Dynaform.

You can also use JavaScript inside the Dynaform to do the same thing:
Code: Select all
var field1Original = $("#field1").getValue();

var formId = $("form").prop("id");
$("#"+formId).setOnSubmit(function() {
    if (field1Original != $("#field1").getValue()) { 
          $("#field2".setValue("changed");
    }
});       

If you want to do it with JavaScript, then create a hidden field n
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]