Formatters on Client Side

Hi!
I’m trying to urldecode() something on the client side. I know I need to use the javascript version.

This was helpful:

howto/can-someone-explain-dmx-formatters-and-provide-some-reference-on-how-to-use-it/26597

But I cannot get this to work. It throws no errors, it just doesn’t decode anything. Help me please.

I have this in my file:

    <script>

        dmx.Formatters('string', {

        urlDecode(val) { 

            return decodeURI(val); 

            }

        });

    </script>

    <meta charset="utf-8">

Later on, when I’m displaying the text (in a variable/string) that needs to be changed I have this:

{{T_Question.urlDecode()}}

I don’t know why it’s not working. But, I’m not very good at javascript.
Thanks!

Community Page
Last updated: