Inputmask icon indicating copy to clipboard operation
Inputmask copied to clipboard

How do I remove the character"_" at the end of the value?

Open andriireblian opened this issue 3 years ago • 2 comments

Hello @RobinHerbots ! Could you help me remove the character "_" when I choose country which support 8 or 9 numbers (for example: Ireland), please? If I enter 8 numbers and take the focus away from the input, then the character "_" remains.

  • OS: Windows 10
  • Browser: Chrome Version 87.0.4280.141 (Official Build) (64-bit)
  • Inputmask version: 5.0.4-beta.33

andriireblian avatar Jan 14 '21 20:01 andriireblian

Did you manage to find a solution to this? I'm having the same problem and saving underscores to the database. as they're coming through in the form data.

I recently updated from 3.3.4 to 5.0.7 and this didn't happen before the update. I've looked through the docs but struggling to find anywhere which will turn off this behaviour.

jimbo1999uk avatar Jan 10 '22 11:01 jimbo1999uk

add

placeholder: ''

to options

claudiogg88 avatar Jul 28 '22 15:07 claudiogg88

@andriireblian ,

You will need to make the extra character optional or work with an alternating mask.

Something like

	Inputmask(
		{
			mask: "99 99 99 99[9]",
			greedy: true
		}).mask("#test2");

RobinHerbots avatar Nov 07 '23 08:11 RobinHerbots