I would assume that dmxFormatter is capable to sum client-side form field values? I am having trouble displaying the sum of a repeating hidden field.
I have a layout similar to this and the data source is datastore:
<form id="cartForm" method="post" is="dmx-serverconnect-form" action="dmxConnect/api/order/checkout.php">
<div class="row" is="dmx-repeat" id="rCart" dmx-bind:repeat="cart.data">
<div class="col-12">
<div class="col-2 text-center align-self-center">
<dmx-data-detail id="ddPrice" dmx-bind:data="films.data.films.where(`id`, film_id, "==")"></dmx-data-detail><input id="linePrice" name="linePrice" type="hidden" class="form-control" readonly
dmx-bind:value="(member_id == 1 ? (ddPrice.data.price_nonmembers.toNumber() * qty) : (ddPrice.data.price_members.toNumber() * qty))" dmx-bind:name="record[{{$index}}][linePrice]">
<p>{{(member_id == 1) ? (ddPrice.data.price_nonmembers.toNumber() * qty).formatCurrency("£", ".", ",", "2") : (ddPrice.data.price_members.toNumber() * qty).formatCurrency("£", ".", ",", "2"))}}</p>
</div>
</div>
</div>
</form>
I would then try to use {{cartForm.data.repeat1.sum(
linePrice)}}
elsewhere on the page to display the result.
At the moment it is blank. Any tips would be appreciated.
Community Page
Last updated:
Last updated: