How I put a currency mask on a input of dhtmlxForm?

I wanna know how put a mask in a input text of dhtmlxForm.
For example, $1500 will be $1.500,00 (this format)
And a wanted on event “OnKeyUp”.
I need this help.

Thanks


Daniel Aredes

hi for all
i found a solution:

:::get a input from dhtmlxForm

var t_field = formDhtmlx.doWithItem("field_dhtmlx", "getInput");

:::get event

t_field.onkeyup = function(e){ currency(t_field); // using a javascript function. This masking like on event onKeyUp: 1.500,00 };

::: function used

function currency(z){ v = z.value; v=v.replace(/\D/g,"") v=v.replace(/[0-9]{12}/,"inválido") v=v.replace(/(\d{1})(\d{8})$/,"$1.$2") v=v.replace(/(\d{1})(\d{5})$/,"$1.$2") v=v.replace(/(\d{1})(\d{1,2})$/,"$1,$2") z.value = v; }

Hello,

You also can use onchange event.

I really like this subject. Could you tell me more … I would love to explore.

currency rates in pakistan