Is there a way to assign variable to an Element Name so that I can access the element and change the values:
[% FOREACH field IN ['id','type','updatedt','lastcheckdt'] %]
<div class="row col-md-3 col-sm-6">
<dl class="details-dl">
<label>[% field %]</label>
<div class="details-dg">
<dd name=[% field %] class="float-right">[% order.$field %]</dd>
</div>
</dl>
</div>
[% END %]
I can format the datetime for updatedt:
let dt_formatted = convertDateFormat("[% order.updatedt %]");
$( "[name='updatedt']" ).val(dt_formatted);
Unfortunate assigning [ % field %] to name does not assign any value to name:
<dd name=[% field %] class="float-right">[% order.$field %]</dd>
2
Answers
use .html() instead of .val to access the property in
<dd>
Looks like your are missing the quotes here: