Input Mask Reverse


Topic: Input Mask Reverse

hypeIT pro premium priority asked 3 years ago

Expected behavior I want to use an input mask for a currency. The currency needs to display with cents, "500,30€" or "1.000,87€" for example.

Actual behavior https://mdbootstrap.com/docs/standard/plugins/input-mask/

I didn't find an option to reverse-mask the input, so the comma at the end will be added when typing the 3rd character. Is it possible?

Resources (screenshots, code snippets etc.)


Michał Duszak staff commented 3 years ago

Hello, I'm afraid that this plugin doesn't provide such an option


hypeIT pro premium priority commented 3 years ago

Is there any possibility to accomplish that behaviour with custom-masks or anything else?


Michał Duszak staff commented 3 years ago

You would have to write custom JS for this. Input mask wouldn't work by it's own in this case, because it can't dynamically definie new input masks. It might suit one case, like 1.000,87, so that the mask will be "9.999,99" but then you wouldn't achieve "500,30" like in "999,99" mask.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: Yes
Tags