473,508 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I check whether input data is only in string format?

1 New Member
i want to checked whether user entered data is only in character form..
means user not allowed to enter numerical data into textfield.
if user enter numerical data then give alert message.
Jan 19 '13 #1
2 1707
Rabbit
12,516 Recognized Expert Moderator MVP
This is not a code writing service but if you post the code you've tried along with a description of the problem, we can help guide you to an answer.
Jan 19 '13 #2
Anas Mosaad
185 New Member
Expand|Select|Wrap|Line Numbers
  1. var re = new RegExp('^[A-Za-z]+$'); // change the regular expression to match your case
  2. var valueToCompare = document.getElementById('YOUR ELEMENT ID').value;
  3.   if (valueToCompare.match(re)) {
  4.     alert("Successful match");
  5.   } else {
  6.     alert("No match");
  7.   }
  8. }
  9.  
Jan 19 '13 #3

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

Similar topics

2
2934
by: Uri Dor | last post by:
Hi, everyone, The question is whether there is (or can be) an FxCop rule that makes sure I don't do this: String.Format("{0}-{1}-{2}", 5); Or similar things. Some explanations: 1) of course I...
4
13619
by: Tiraman | last post by:
Hi , I Would Like To Convert Some HEX Data to string format and opposite . does vb.net has some functions for that ? 10x -- Best Regards ,
4
2168
by: ija | last post by:
i try to limit the user key in integer at least 1 and not more than 8. pls help me..
1
2337
idsanjeev
by: idsanjeev | last post by:
how can check the input data is character or numeric if input data accept the numeric and input data is character then error message
8
28116
idsanjeev
by: idsanjeev | last post by:
how can check the input data is character or numeric if input data accept the numeric and input data is character then error message
3
14532
Maidenz08
by: Maidenz08 | last post by:
How do i check whether an email id exists or not? I am following a three step validation process.. 1) syntax validation- which is pretty straight forward 2) DNS validation - I'm able to do...
3
3691
by: aksh4u | last post by:
I am prompting the user for name if he/she returns non empty string validate the input string it should contain only alphabets no special characters or numbers else if he/she...
2
1514
by: sweatha | last post by:
I have created a login form in asp.net web page.Just like that I have created a table named login which has 2 fields as username & password in SQL Server 2000. I have to check whether the...
6
2909
by: Lilith | last post by:
I'm trying to build a string for eventual output to a file. Input comes from a number of input boxes but I've only test on one text box content when I get an exception at runtime. The program...
11
20984
darksteel21
by: darksteel21 | last post by:
Hi All, I am currently developing an application that reads data from PC's Memory. It is working but the output is something like this: (Please see attached..)...
0
7227
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,...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7391
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...
1
7054
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...
1
5056
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...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
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 ...
0
424
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...

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.