Topic: Customize an input mask behaviour

Břetislav Válek free asked 2 years ago


Dear support,

please advise me with customizing a behaviour of an input mask.

We use input mask for inputs fields where we need users to type several numbers right after "27ZG" code. Up to this point, everything is fine.

Now we need customize two more things in the input field as follows:

1st: Display a cursor right after "27ZG" code.2nd: Prevent deleting already written values by clicking out of the input. (When input is not in focus).

For better uderstanding, I have prepared a snippet here: https://mdbootstrap.com/snippets/standard/bretislav_valek/3691145

Thank you for any support provided.Bretislav


Michał Duszak staff answered 2 years ago


Hello. I prepared some custom code for first issue - "27ZG" will be inserted at the beginning each time, and if user will decide to delete that - input value will be cleared with "27ZG" at the beginning. Second issue could be resolved by adding data-mdb-clear-incomplete="false" attribute into your input mask.

Here is the snippet: https://mdbootstrap.com/snippets/standard/m-duszak/3695138#html-tab-view



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

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.2
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes