I have a form with a select list where the value is a number (id)
Now I want to add a field that will convert the given number into a value (currency).
For now I have it as static values like:
<input id="prijs" name="prijs" type="text" class="form-control" dmx-bind:value="select1.value.toNumber().toString().replace(1, 100).replace(2, '75').replace(3, 50).replace(4, 35).replace(5, 25)">
Here I bump into my first issue. E.g. the conversion with "replace(2, ‘75’) does not change the value to 75 but to 725 as it replaces the 5 in 75 to 25 as in the last replace. Same goes for all the other values like all fives are replaced by 25 and 3 is replaced by 50.
Question 1: how can I solve this to get the right values?
Question 2: how can I get the values to be replaced from a Server Connect Action if at all possible
Last updated: