Number 9 doesn´t appear

I am changing the formar of the phone number in Entity Type Custom Fields, and I want this format:

+569 # ### ####

The problem is that the number 9 does not appear in the form when I want to create a new customer.

The same thing happens with number 0

String reads special characters as specific functions… # tells it to expect a number input… so 9 is more than likely reserved. Maybe @emre can look at it for you.

Thank you @Jesse for your answer.

I am using it as a String. I tried with Widestring and the same thing is happenning.

Which SambaPOS version are we talking about?

I downloaded it yesterday. It’s 4.1.65

Here is a list of meanings of all masking chars.

0 Digit, required. This element will accept any single digit between 0 and 9.
9 Digit or space, optional.
# Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the Text property. Plus (+) and minus (-) signs are allowed.
L Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions.
? Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions.
& Character, required. If the AsciiOnly property is set to true, this element behaves like the “L” element.
C Character, optional. Any non-control character. If the AsciiOnly property is set to true, this element behaves like the “?” element.
A Alphanumeric, required. If the AsciiOnly property is set to true, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the “a” element.
a Alphanumeric, optional. If the AsciiOnly property is set to true, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the “A” element.
. Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider, as determined by the control’s FormatProvider property.
, Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control’s FormatProvider property.
: Time separator. The actual display character used will be the time symbol appropriate to the format provider, as determined by the control’s FormatProvider property.
/ Date separator. The actual display character used will be the date symbol appropriate to the format provider, as determined by the control’s FormatProvider property.
$ Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control’s FormatProvider property.
< Shift down. Converts all characters that follow to lowercase.
> Shift up. Converts all characters that follow to uppercase.
| Disable a previous shift up or shift down.
\ Escape. Escapes a mask character, turning it into a literal. “\” is the escape sequence for a backslash.
All other characters
Literals. All non-mask elements will appear as themselves within MaskedTextBox. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.

So you can escape them as \+\5\6\9 # ### ####

2 Likes

That´s great! Now it works!

I have another problem now, when I click the field Phone the cursor goes to the right of the last #, so I have to move it manually to the first #. Is there a way where the cursor will appear always in the first # if you press anywhere in the field when the # are empties?

Do I explain myself?

Can anyone help me with this?

Have you tried:

\+\5\6\9 0 000 0000

Might help, otherwise @emre will need to adjust code to put the cursor at the beginning (left) of the field. It seem like odd behavior that you are experiencing…

Yes, I tried with # and with 0. Same behavior.

@emre Am I doing something wrong or SambaPOS is defined to behave like that?

@dcarey can you update your sambapos to latest one and try again?

Now is working perfect! Thank you very much!

1 Like