how do i force input format for textbox?

jalo

Freshman
Joined
Aug 9, 2005
Messages
28
Can anyone give me an idea of how i can force a particular predefined format for the input in a textbox?... in particular, i need to force 2 things (on 2 different texboxes):

1. date entry of the format mm/dd/yyyy
2. entry of the format xx-nnnn-nn (where x=alphabetic and n=numberic)

any advice would be greatly appreciated!
 
I am assuming you need the date in that format to put in a report of somesort. I would let the user put the date in however they want to, and convert it before you generate the report, or put the data in the database, or whathave you.
Visual Basic:
If IsDate(YourTextBox.Text) Then
    Format(YourTextBox.Text, "mm/dd/yyyy")
End If
I don't know, but you would probably need to write a custom function to do the second validation.
 
SonicBoomAu,

i am not familiar with masked textboxes but it sounds like what i need - however i am reading here this is not supported in .Net - so how do i deal with that?

what is the name of the event i need to handle that is for validation upon the user leaving the field?

thanks for advice...
 
Back
Top