Creating a thousand Separator on a custom form field


I am starting to use DHIS2 so far its a great tool but quite dificult to understand out of the box, Right now i am trying to make a thousand separator for a number field, i have a small dataset with just one data element and i want to make it write thousand separators as you type so instead of typing 10000 i will get 10.000 and so on.

I know i have to use a custom form for this and do some javascript, however i cant get the right code to work. Tried something like this (i am no programmer just trying to pull this on my own):




The original code was taken from here:

I cant make this work, maybe someone has something that actually works. Any ideas are appreciated, thank you.


Patricio López Salgado