Hi Fabrik Community,
I've been working with JDate elemnts and have encountered an issue when updating their values using JavaScript. It seems that simply setting the value via JavaScript doesn't always reflect the change visually until the field receives focus.
Problem:
When I use a JavaScript tab in button element to update the value of a JDate field, the value displayed changes correctly but the field doesn't update until I click on the field or tab to it, effectively giving it focus.
Solution:
I've found a workaround to ensure the JDate field get focus immediately after update
Example:
var dateField = Fabrik.getBlock('form_15').formElements.get('my_jdate_field');
dateField.set(newDateValue);
// Force focus to the field to trigger visual update
document.getElementById('my_jdate_field_cal').focus();
I've been working with JDate elemnts and have encountered an issue when updating their values using JavaScript. It seems that simply setting the value via JavaScript doesn't always reflect the change visually until the field receives focus.
Problem:
When I use a JavaScript tab in button element to update the value of a JDate field, the value displayed changes correctly but the field doesn't update until I click on the field or tab to it, effectively giving it focus.
Solution:
I've found a workaround to ensure the JDate field get focus immediately after update
Example:
var dateField = Fabrik.getBlock('form_15').formElements.get('my_jdate_field');
dateField.set(newDateValue);
// Force focus to the field to trigger visual update
document.getElementById('my_jdate_field_cal').focus();