Jump to content

InputMask optional character


fiorilli

Recommended Posts

Hi Delphi Developer,

 

Thanks for replying, your mask "works".

 

But the optional 9 must be at the beginning of the mask after (99). So it would be ideal:

(99) [9]9999-9999

 

Pasting the mask to this format, it does not work.

 

The equivalent in the desktop VCL would be:

(99) #9999-9999

 

Is there any other way?

Link to comment
Share on other sites

On 9/5/2018 at 6:15 PM, fiorilli said:
But the optional 9 must be at the beginning of the mask after (99). So it would be ideal:
 
(99) [9]9999-9999
 
The equivalent in the desktop VCL would be:

(99) #9999-9999

Hi,

It is not clear to me how you will assign a value in this case ?

Link to comment
Share on other sites

Think about this for a minute...you cannot use the optional character in the front as you are filling the mask from left to right thus you will need to use the mask at the end like this: (99) 9999[9]-9999.

(00) 1234_-___

And when you get to the 5th number you have to press the separator character (-) as the application does not know if you want to enter 4 or 5 numbers before the -, hence you need to indicate to the application that you only want 4 by pressing the separator (-). The application will then move the (-) one position left and let you fill in the remaining 4. 

;)

Link to comment
Share on other sites

21 hours ago, Sherzod said:

You can use right arrow key for this

Sorry, how to use the right arrow to solve the problem of removing the leftover character?

20 hours ago, GerhardV said:

Think about this for a minute...you cannot use the optional character in the front as you are filling the mask from left to right thus you will need to use the mask at the end like this: (99) 9999[9]-9999.

(00) 1234_-___

And when you get to the 5th number you have to press the separator character (-) as the application does not know if you want to enter 4 or 5 numbers before the -, hence you need to indicate to the application that you only want 4 by pressing the separator (-). The application will then move the (-) one position left and let you fill in the remaining 4. 

;)

Why can not I use the optional character on the front? VCL Desktop allows this and other javascript plugins available on the web also allow!

Apparently this is a particular case of ExtJS and InputMask.js used in UniGui. So I'm checking to see if there really is no other way before going to a third-party plugin.

The optional character in the middle of the mask is a bad UX. Setting at the beginning or end of the mask, I would not have problems with UX. But in both positions does not work.

Link to comment
Share on other sites

I don't understand your argument, you have to press a space at the end to change the mask format anyway to let the application know. That isn't any different from pressing the separator (-) after you have entered 4 digits and don't want a 5th digit. Have you even tried my suggestion? 

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...