Is there a way to assign a variable to the element name so that I can access the element and change the value:
[% FOREACH field IN ['id','type','updatedt','lastcheckdt'] %][% END %]
- [% order.$field %]
I can format the updated datetime:
let dt_formatted = convertDateFormat("[% order.updatedt %]"); $( "[name='updatedt']" ).val(dt_formatted);
Unfortunately, assigning [ % field %] to the name does not assign any value to the name:
Use .html() instead of .val to access properties in
Looks like you're missing quotes here: