On Feb 17, 2006, at 12:31 PM, Jonathon Bevar wrote:

I have an editfield what uses a mask and I was wondering if I am doing it correctly.

editfield1.mask="(###) ###-####"

Now when you enter data you have to do a Shift 9 to first enter the "(", why is this? A mask should just be there to keep order as to how the data is entered and have NO real connection to the enduser's entry. Once the "(" is enter manually by the user the rest of the mask works ok as you do not need to enter the ")" or the "-" in the mask, only the first part of the mask you have to enter the "(".

Now this may make some endusers upset as they may not know this and it will cause a few bug reports to my software. So tell me, i'm I doing it right or am I missing something?

Other than very basic stuff, I have not found the Mask property to be flexible enough for my needs and telephone numbers have a lot of possible variations.

Another approach is to validate the input after the field has lost focus (such as tabbing to another field or clicking on a button), or inline with the TextChange() event. This would allow you to accept telephone numbers in a variety of formats including "(###) ###-####", "(###) ###-#### x####", "###-###-####", "###.###.####", "##########" or even *international* telephone number formats which almost never follow the US format.

This is the type of approach that I took with the phpRegistration example... it allows the user to input the data (even incorrectly) but does not allow them to submit the data. Also, if the text evaluates as valid but in a different format you can use the LostFocus () event to enforce the telephone format you expect: 493.555.1039 => (493) 555-1039.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to