Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 July 15th, 2012, 06:53 AM
Registered User
 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to restrict special character and number in textbox ?

Hi,
I would like to use regualar expression validation contros to validate a multiline textbox in such a way so that
user unable to enter certain words (like numbers in words one , two, three, four, rediffmail,yahoo com,gmail).

For example when any user try to show his phone nuber like my phone nuber is nine two three four like that.
Then he got * mark as a validator because in text box one can not enter such words.
Please help me.

Last edited by abhishek_kumar_rch; July 15th, 2012 at 09:08 AM..
 
Old July 16th, 2012, 12:34 AM
Authorized User
 
Join Date: Jul 2012
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Hello, abhishek_kumar_rch: I would suggest you check out Regular Expressions (Visual Studio) for complete information on how to filter on certain words. You can enter your expression by adding the validator to the page, referencing the control to be validated, and then entering the expression in the textbox provided on the properties page for the control.

If you wanted to permit only numbers, for example, you could use:

Code:
($[0-9]+)
Again, the link above takes you to details on how to filter on regular expressions. Happy coding!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation for special character nazneen Java GUI 5 February 13th, 2006 03:13 PM
Decimal code for a special character mcinar HTML Code Clinic 14 February 4th, 2005 01:56 PM
Special Character mg1966 Classic ASP Databases 2 December 13th, 2004 11:12 AM
XML - Special Character Formatting sean1230 XML 3 February 18th, 2004 05:17 AM





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