473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

code for validation of textbox ONLY FOR ALPHABETS doesn't contains any kind of other

Hello,

I would like to get the Javascript code to check the textbox contains only text(alphabets or characters) values not any number or combination of alphabets and numbers or special characters..
Apr 11 '13 #1
2 2300
Dormilich
8,658 Expert Mod 8TB
that should be no problem with regular expressions.
Apr 11 '13 #2
omerbutt
638 512MB
hi Mohinee,
see below
Expand|Select|Wrap|Line Numbers
  1. var text=$('#textarea_Id').val();
  2. if ((/[^a-z\ ]/gi).test(text)) {
  3.  
  4.             alert(text+ " contains invalid character(s)");
  5.  
  6.             return false;
  7.  
  8.         }
  9.  
regards,
Omer Aslam
Apr 25 '13 #3

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

Similar topics

7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
1
by: Solitus | last post by:
I have a form for a customer to edit his customer information. It has several textboxes that I will populate with some existing data from the database before displaying the form to the user. I...
5
by: Chris H | last post by:
Hello All, Hope all is having a cool holiday season... I am looking for a code validation tool for VB.NET. It should be able to point out variables that are not in use as well as ways to make...
6
by: salo | last post by:
Can anybody say me for writing javascript code for textbox key press event such a way that it should allow only alphabets,dot and spaces
17
nitindel
by: nitindel | last post by:
Hi All, I have a text box and want to validate it like this: I want to enter Numerics or alphanumerics in the text box but not Alphabets alone.If Alphabets alone entered then...
2
by: Alpha83 | last post by:
Hi, Is it safe or error-free to validate country zip-codes using regular expressions - especially for countries like UK or Canada, where there are different alphanumeric formats. Here's what I...
2
by: sohil | last post by:
How to open a file that contains some other extension like(.mxd) when button is click
0
by: atish anerao | last post by:
I want to Validate TextBox only number & enter key and ctrl +V how can i do in c#
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.