Hi all!
I have a date picker with an on change handler that updates the value to date of another item in my collection, so far this works properly but when saving it does’t store the new value updated by the function.
I have tried manually modifying the value for instance in an input box and then it gets saved properly.
Am I missing something here?
Thanks in advance
From the DatePicker docs:
value
Sets or gets the value of the date picker.
Note
Changing a date picker’s value in code does not trigger an onChange event.
If a date picker is connected to a dataset, setting the date picker’s value in code does not set the value of the connected field in the dataset. That means if you use the dataset to perform a submit, the value changed in code is not reflected in the submitted item.
To submit the new value using a dataset, set the field’s value using the setFieldValue() function before performing the submit.
Read the part in bold extra carefully. Good luck.