473,804 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

regularexpressi onvalidator so that user can't fiil spacebar

18 New Member
Hi all,
I have a problem in regularexpressi onvalidator. I need that user can not enter any spacebar into the textbox.
Mar 23 '07 #1
5 1374
keithmdennis
3 New Member
Do you mean you don't want any spaces in the TextBox input? Just numbers and letters and other characters?
Mar 23 '07 #2
prp
18 New Member
Do you mean you don't want any spaces in the TextBox input? Just numbers and letters and other characters?
yes i need only number in the textbox
Mar 23 '07 #3
keithmdennis
3 New Member
yes i need only number in the textbox
try this:

1. ^[-]?([1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|\\.[0-9]{1,2})$ for numbers with decimals.

2. ^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^1000000$ for integers between 1 and 1000000.

Is this what you were looking for?
Mar 24 '07 #4
prp
18 New Member
try this:

1. ^[-]?([1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|\\.[0-9]{1,2})$ for numbers with decimals.

2. ^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^1000000$ for integers between 1 and 1000000.

Is this what you were looking for?
yes but if user press any spacebar in the textbox it should give an error message.
Mar 24 '07 #5
archvivek
5 New Member
hello

First keep a regular expression validator next ur require textbox.
Right click and get into the properties.
set the according properties...
Control to validate property-(required textbox name)
Display property-Dynamic
Error message- required message
Validate expression property- ^[0-9]*|\d*\d{1}?\d*

It should work now...

Like this there are various expresssions for each and every validations.
Mar 25 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1898
by: julio | last post by:
I noticed that pressing spacebar when a listbox has the focus scrolls the listbox to the first selected item. I'm intercepting the spacebar press event at form level for stopping and starting audio playback, so I would like to remove the default behaviour form the listbox, and also from other buttons and controls. I tryed ( following a tutorial ) to subclass the listbox class, but I was able to intercept only mouseclicks, not the...
16
2560
by: MLH | last post by:
In Access 97 and Access 2.0 applications, if a command button has the focus, the spacebar will 'PRESS" the key. How does one go about disabling this annoying BEATURE?
0
3018
by: Andy Eshtry | last post by:
I have a radio button list, a textbox representing SIN or EIN based on my radio button list selection so I put 2 regularexpressionvalidator to evaluate the value of textbox. EIN must be (for simplicity) with this format (2 digits) like 12 (ValidationExpression="\d{3}-\d{2}") and SIN must be (for simplicity) with this format (3digits-2digits) like 123-45 (ValidationExpression="\d{3}-\d{2}") It works well. The problem is: When I...
1
1563
by: rockdale | last post by:
Hi, all Is there a way to dynamically attach a regularexpressionvalidator to a textbox base on dropdownlist selected item? Let's say I have a dropdownlist list all contact type - phone, cell, email ...etc and a textbox that allow user to type in their contact info. When they choose email, I want attach the regularexpressionvalidator of email to the textbox, when the ddl selected phone, then I want attach phone regExp to the same...
4
6059
by: =?Utf-8?B?Y3VyaW91cw==?= | last post by:
I am using a RegularExpressionValidator to validate a TextBox. I use "^?+(\.*)?$" to check for a real number. The control works fine as long as the user enters something in the TextBox; it does not work if the user leaves the TextBox blank. Is there a bug in the implementation of the RegularExpressionValidator? The above regluar expression should also catch no entry by the user. I have added a RequiredFieldValidator to solve the...
9
3931
by: Nathan Sokalski | last post by:
I have several TextBoxes with TextMode="MultiLine" in which I want to limit the number of characters that can be entered using a RegularExpressionValidator. I have come up with the following ValidationExpression: {0,250} The only problem with this ValidationExpression is that it does not include the \n character as stated on the following documentation page:
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10350
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.