Filling in the value of field based on another field using dependent() and momentjs.
Filling in the value of field based on another field using dependent() and momentjs.
huba_sbf
Posts: 16Questions: 6Answers: 1
Hello,
I am trying to automatically set a value for "field2" when editing the value of "field1".
The code below is supposed to auto fill the value of "field2" with the value given to "field1". And it actually works!
editor.dependent( 'field1', function ( val ) {
if (val != '') {
editor.field( 'field2').val(val);
}
});
However it does nothing when using the timepicker I have found in this example: https://editor.datatables.net/examples/dates/time.
Any thoughts? Thanks a lot.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
That does indeed appear to be a bug. Let me look into it and I'll get back to you.
Regards,
Allan
OK, thank you very much, looking forward to it.
Any news regarding this issue or an ETA or why not, some workaround?
Thank you Allan.
I've afraid I've not had a chance to look into this in the last two days. I'll post back here as soon as I have done.
Allan
OK, thank you very much!
Hi,
Little update - this is indeed a bug in the shipping version of Editor. I've committed a fix for the next version. Until then, there is a workaround available in this thread.
Regards,
Allan