Input Mask Reverse


Topic: Input Mask Reverse

hypeIT pro priority asked 1 months 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 commented 1 months ago

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


hypeIT pro priority commented 1 months ago

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


Michał Duszak commented 1 months 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.
Status

Answered

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