I want to prevent users from submitting the form when the “Date de résolution” field is filled but the “Commentaires de résolution” field is empty.
Currently, I’m having trouble implementing an onsubmit
action that displays an error message while keeping the edit screen open for users to make corrections. To address this, I’ve created a button (RUN ACTION) linked to a custom action.
However, I’ve encountered a challenge: the “Commentaires de résolution” field does not update in real-time until the user submits the form, which means the action cannot read the current data the user has entered.
In this screenshot, I clicked the button to run the action, and the behavior is as expected:
In this screenshot, the behavior is not as expected:
How can I make the custom action check the current value of the “Commentaires de résolution” text field (which hasn’t been saved to the database yet) from the edit screen?