• Fabrik4.5.3 for J!5.3.0 and J!4.2+is out

    You must update from Fabrik4.5.1 if you are running Joomla!5.3.0

    See Announcements

JDate Element Update requires Focus to update value

GabPag

New Member
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();
 
Great! The old elements have always been causing all kinds of problems. Probably due to the conversion of the various non-English date formats.
@achartier How is the work coming along on J5, by the way? Could you please update the Milestones? Thanks in advance!
 
Back
Top