I have an input event handler in JavaScript which is used to modify the input. Modifying this.value in the input event handler function changes the value displayed in the element (input box), but the value of the OutSystems variable bound to that element is not updated.
(The reason for changing the value in the input event handler was to format the input in the input box as the user types.)
E.g., In the attached OML, the JavaScript modifies this.value to append a "." on the input event, but the value displayed in the message when the button is clicked is still the old value "hello". However, when the input event handler function does not change this.value, the value displayed in the message is the updated input box value as expected.
Can someone please explain why the value is not getting assigned to the OutSystems variable when the input event handler modifies this.value?
As a workaround (not shown in the OML), in the submit action, I had to take the value from the input box instead of from the OutSystems variable.
Hello Tushar,
Your question is similar to another answered question by Tigo RodriguesYou can find the question and answer here: https://www.outsystems.com/forums/discussion/97102/trigger-the-change-of-a-bind-variable-by-changing-an-input-value-with-javascript/
I've attached an oml with the implemented solution.
Thank you for the reply. The solution you have provided is working.