What is wrong with this "replace"?

There must be some typo in here, but I am not seeing it. Anyone else knows what is wrong?
<select id="inp_onderdeel" class="form-control" name="onderdeel" dmx-bind:value="updatefill.data.query1[0].onderdeel.toNumber().toString().replace(2, 'Bestuur').replace(3, 'RvT')">

Try using a string instead of a number for the replace. Also I think the toNumber() is not needed.

updatefill.data.query1[0].onderdeel.toString().replace('2', 'Bestuur').replace('3', 'RvT')

Thanks Patrick. But this doesn’t fill the select field with the correct value either. As you can see in the image it works fine in the list but not entering the right value in the select field

How are the options for the select, don’t you use the number for the value and the text for the labels? When using the number for the value you don’t need to use the replace.

1 Like

Sheesh. Was thinking too difficult again. Solved!
Thank you.

1 Like