|
-
May 23rd, 2005, 03:19 PM
#1
Thread Starter
Addicted Member
input mask
how do you make input masks for things like phone numbers and social security numbers?
Last edited by citizenstitch; May 25th, 2005 at 01:35 PM.
-
May 23rd, 2005, 04:47 PM
#2
Re: input mask
you could use regular expressions http://www.regular-expressions.info/tutorial.html
Here is one for a email address \b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b
Matching Vaild dates 19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])
usage example
VB Code:
Dim x as New System.Text.RegularExpressions.RegEx("\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b)
Msgbox(x.Match("aInvaildEmail2woot.ca"))
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
May 24th, 2005, 10:05 AM
#3
Thread Starter
Addicted Member
Re: input mask
how do i make this check a textbox? great post by the way. it took me awhile to understand the code but the website helped.
-
May 24th, 2005, 12:50 PM
#4
Re: input mask
VB Code:
Dim x as New System.Text.RegularExpressions.RegEx("\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b")
If x.Match(TextBox1.Text) Then
Msgbox("Vaild Email!")
Else
Msgbox("Invaild Email!")
End if
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
May 24th, 2005, 01:13 PM
#5
Thread Starter
Addicted Member
Re: input mask
it underlines x.Match(TextBox1.Text) and says it can not be converted to boolean
Last edited by citizenstitch; May 25th, 2005 at 12:36 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|