CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.faq_frequently_asked_questions Tags:
Item Type: NewsGroup Date Entered: 9/5/2007 11:54:42 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 50 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
suhasini vimane
Asp.Net User
Validations9/5/2007 11:54:42 AM

0

Hi,

I am working on Asp.net 2.0. My question is  about mobile number validations such as +91XXXXXXXXXX. And the number should not be more than 10 digits(excluding +91). How i can put such a validations? Kindly suggest me on this.

Peter Smith
Asp.Net User
Re: Validations9/5/2007 12:47:48 PM

0

 use a regular expression validator with the expression:

[+0-9]{13,}


this will allow characters + and 0 to 9 with a minimum of 13  (+3 because of the +91)

hth

ps, if it doesnt work play around with it a bit, but on top of my head this should do it...

hth


please mark answers as Answered and please post back solutions when you figure stuff out.

fight Google domination, use search.live.com
suhasini vimane
Asp.Net User
Re: Validations9/6/2007 5:38:44 AM

0

I worked on it, but it's not working. It is accepting any values including characters also and not checking whether '+91' is added or not.
Peter Smith
Asp.Net User
Re: Validations9/6/2007 7:58:44 AM

0

 Owwww, I didnt know that you always needed the +91..

I have 2 suggestions:

if its always +91 why not put the +91 value in a dropdownbox? (that way you can later easily add other phonenumbers) or perhaps just put it as text in front of your textbox to indicate to the user that he doesnt have to type the +91
secondly: for testing regular expressions: http://www.ultrapico.com/Expresso.htm


with regard to the expression itself, try this: [+91]{1}[0-9]{10}

HTH


please mark answers as Answered and please post back solutions when you figure stuff out.

fight Google domination, use search.live.com
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:




   
  Privacy | Contact Us
All Times Are GMT