CalcBuilder Forum

Add predefined mask in text input

User moon_1480 2014-02-20 23:27:10


I need for my project to add a predefined mask in text input.

I had it in js file ; /www/modules/mod_calcbuilder/assets/js/jquery.meio.mask

Line 142 : 'mymask' :{mask:'AA-999-AA-999' }, ...

But there didn't work.

I see which certain mask not appear in the choice like cpf (cadastro nacional...)

Have you a solution for my problème ?


Moonsoft support 2014-02-21 09:54:22


Instead of creating a new mask in js file, did you try to write the mask in the text field on the right of the mask property inside field configuration?


User moon_1480 2014-02-23 17:37:44


OUPS ! I don't see it's possible to do this.

It's work like a charme.

Thank's a lot

Moonsoft support 2019-01-16 14:14:31


I needed to have entered number formatted with input mask like this 999,999,999 (integer us)
And to allow entering numbers only. Input mask option is used for tasks like that.

In order to do so in your system - fields needs to be set as text type,
because when field is set as number, there is no input mask available as option.

Problem: when I change field from from number type into text type, to use input mask,
calculation doesn't work any more.

Any suggestions how to have both input mask and calculation ability?


Moonsoft support 2019-01-17 09:08:03

yes, if you format the numbers, they are no longer numbers, but plain texts, either for php or the excel cell. In order to make further calculations with such formatted values, you would need to convert them back to numbers, and then launch your operations. If you have your math in php formulas you could just remove all the ' , ' characters and you will get a valid number again. If you use an excel file, you could also replace the commas, and/or use any built in function like VALUE to extract the number from that formatted text. Here we found some tips to get a number from a formatted text using excel formula:

Hope this helps, regards


Create dynamic calculators

Buy now!
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!