Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 23rd, 2008, 09:07 AM
Authorized User
Join Date: Dec 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dharmeshtandel
Default Mobile number Validation


i have a one problem regarding the Mobile Number validation.
i want to prevent the Mobile number having the same sequence,
forexample : 0000000...,111111....,22222....,...,9999.... and 123456769

i have mobile number textbox with the maxlength is 15.
   so if anybody having the idea regarding the this kind of validation
then please give the right solution.

Old April 23rd, 2008, 09:13 AM
Friend of Wrox
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post

Just a note on validation, be wary when limiting the input in fields. There is nothing worse than wanting to punch a number in in a format that you use, only to have the stupid app beeping at you.

For example, I sometimes enter numbers with spaces to make it easier to read back (such as credit card numbers). Not to mention international numbers and the extra digits required for them, and the fact some people enter the "+", while others do not.

In many instances you want to allow certain input (such as spaces, brackets and pluses) and validate ignoring them, rather than limiting the input at the UI level.

As for actually doing it, there are a number of ways, from char-to-char parsing (reading one in at a time and making sure it what is expected) to RegEx to simply cleaning it and hoping for the best! There are plenty of resources that google can reveal on this.

Old April 23rd, 2008, 01:12 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Also be aware of "name calling". Some people can be reached by dialing 0800-Microsoft or 0900-Pizza for example.... ;)

Imar Spaanjaars
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation For Phone Number and Mobile Number dhruthi.ram99 Javascript How-To 12 October 30th, 2011 07:24 AM
Getting mobile phone number yukijocelyn C# 2005 0 May 28th, 2008 11:43 PM
phone number validation debjanib ASP.NET 1.0 and 1.1 Professional 0 June 6th, 2006 12:01 PM
Number Validation ben805 Access VBA 0 December 5th, 2005 04:06 PM
Number validation jmss66 Classic ASP Basics 2 March 2nd, 2005 11:48 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.