Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Input mask
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00041965
Message ID:
00041979
Vues:
33
>>I have a social security number field in which I need users to be able to type in the number with or without the dashes. I thought that the input mask property would provide for this, but typed dashes show up as extra characters. A format setting for all numeric characters only would also take care of the problem, but there is no such animal. I have tried to intercept the keycodes in the keypress event like this:
>>
>>nodefault
>>if between(nkeycode, (code for 0), (code for 9)) or nkeycode = 45 && 45 = tab
>> dodefault()
>>endif
>>
>>This seems to work at first except that after filling out the field, the cursor won't leave the text box and fire the valid code. It just sits there in the last position. What's happening here? Or better yet, how can I do this more gracefully?
>
>Not answering your question directly, but why do this? We have standard SSN entry boxes for which the hyphen is not accepted (only numerics are), using the Inputmask and Format 'R'. It's easier for the users to do entry without the hyphen, and once they learn it's not only unnecessary but not accepted, they should be quite happy...or is there some other reason?

I agree completely. The problem is that on some forms, a laser wand is used to enter the SSN from certain documents that have the SSN in barcode form, and the SSN has embedded dashes. BTW- Edward answered the question; I had my input mask set to "###-##-####" which accepts number and punctuation. Changing it to 9s did what I want. Thanks Edward
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform