But for this you must have AJAxControltoolkit as ddl and add it to refrences.
This will works perfectly.It will not accept any letters,spaces etc. accept only numbers.
LOL!! Mohamed is correct. You need TWO validator controls to ensure only numeric values are entered. It's very hard to find the right answer on this site, as only a handful of posters actually post the correct answer with no missing (essential) information.
krupalali
Member
24 Points
13 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Jul 21, 2008 05:40 AM|LINK
Hi
I have a telephone number field which may accept following format
+46 85 90 35 518
+358 26 38 03 85
01993 831841
+46 303 778 350
+44(0)1344 621681
(01945) 871007
I need a regular expression to validate above field..
Thanks
Krupa.
veeranji
Member
85 Points
48 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 03, 2008 08:24 AM|LINK
Hi,
I'm looking for the Regular Expression ValidationExpression that will accept only numbers from 0 to 12. No any letters and no any spaces....
---
veeranji nambula
Pavani Sharm...
Member
250 Points
40 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 03, 2008 09:25 AM|LINK
Hello,
Rather than using this regular expression validation you can place this code below text box.
<cc1:FilteredTextBoxExtender ID="Filteredtextboxextender1" runat="server" FilterType="Numbers"
TargetControlID="txtRequestId">
</cc1:FilteredTextBoxExtender>
But for this you must have AJAxControltoolkit as ddl and add it to refrences.
This will works perfectly.It will not accept any letters,spaces etc. accept only numbers.
http://www.hcl.in
veeranji
Member
85 Points
48 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 03, 2008 10:24 AM|LINK
Hi,
thanks...
But it will allow only numbers ranging from 1 to 12.
Presently, I used Range Validator . it works some fine..
---
veeranji nambula
Srikanth Kas...
Contributor
4289 Points
883 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 03, 2008 10:37 AM|LINK
Using this function as a javascript and call it back:
function ismyInteger(s){
var i; for(i = 0; i < s.length; i++){
var c = s.charAt(i);if (((c < "0") || (c > "9"))) return false;}
return true;}
Srikanth Kasturi
Please "Mark As Answer" if my post serves purpose.
veeranji
Member
85 Points
48 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 03, 2008 10:48 AM|LINK
thank you ,, Srikanth
its fine. But any formala for reg ex validator?
---
veeranji nambula
codemobile
Member
134 Points
98 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 04, 2008 11:07 AM|LINK
Use FilteredTextBoxExtender of Ajax for Your Problem.
chalaco01
Member
14 Points
7 Posts
Re: Regulajavascript:__doPostBack('ctl00$ctl00$bcr$bcr$PostForm$ctl04$ctl03$ctl02$QuoteButton',''...
Jun 19, 2009 09:28 PM|LINK
bidware
Member
158 Points
125 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Oct 21, 2009 09:15 PM|LINK
LOL!! Mohamed is correct. You need TWO validator controls to ensure only numeric values are entered. It's very hard to find the right answer on this site, as only a handful of posters actually post the correct answer with no missing (essential) information.
codeK
Member
18 Points
12 Posts
Re: Regular Expression Validator - Numbers only no letters no spaces
Dec 01, 2009 02:47 PM|LINK
Ok If you want to match a floating point numbers use this ^[0-9]*\.?[0-9]+$
You can use this to validate whether a user has entered a number (2) or number with decimals (2.45453).
But if you only want to match whole numbers like 2, 3, 333, 545 etc. use this ^[0-9]+$
numbers only regular expression