I used masked edit box for phone number entry. The thing is, when I check the len, no matter what, I get back 14. Any ways around it?
The 14 comes from (***) ***-****.
Please HELP !!!
Printable View
I used masked edit box for phone number entry. The thing is, when I check the len, no matter what, I get back 14. Any ways around it?
The 14 comes from (***) ***-****.
Please HELP !!!
I set the format to (###) ###-####, and left the mask property blank. Then the length returned only the digits that were entered.
Key in 9999999 and it is formatted () 999-9999 and returns a length of 7. Key in 1239999999 and it is formatted as (123) 999-9999 and returns a length of 10.
Is this what you need ?
That is a new approach. I think i will use it instead. Thanks.
One thing to be aware of is this way does not prevent a user from entering character data into the field. You may need to set up some validation code. Putting the mask into the mask property does prevent a user from entering character data.
Might experiment with it to be sure it does everything you need.
James,
There is also a PromptInclude property for the Masked Edit Control that can be set to false. Then the prompt characters are not counted in the field length.
Appreciate your help. I removed the masked and put in the format that you suggested. I used the count as an error check. Thanks again.