473,320 Members | 1,831 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,320 software developers and data experts.

checking characters in txtfield

149 100+
hi,
i had done validation in my project for the txtfield..if i enter 'UMO' it should take...if i had given 'MOU'..it is also taking....i need is only 'UMO' ..i dont want the combinations...can anyone help me..here is the code

Expand|Select|Wrap|Line Numbers
  1. chkActkey=/^UMO{3}$/;
  2.     if (chkActkey.test(form.actkey.value))
  3.     {}
  4.     else
  5.     {
  6.     alert('Invalid \" Activation Key \" Entry');
  7.     return false;
  8.     }
Thanks in advance,
madhu.
Jun 22 '10 #1
2 1144
Dormilich
8,658 Expert Mod 8TB
why using a RegExp? do a simple string comparison.
Expand|Select|Wrap|Line Numbers
  1. if ("UMO" === form.actkey.value)
PS. neither should match your RegExp.
Jun 22 '10 #2
madhuriks
149 100+
hi,
Thanks for ur answer...its wrkng..fine....

Regards,
madhu.
Jun 22 '10 #3

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

Similar topics

2
by: Mickel Grönroos | last post by:
Hi Pythoneers, Which is the best way of checking that a given unicode string only contains IPA characters, e.g. characters in the range \u0250-\u02AF? I guess a regular expression would do it,...
3
by: Frank Niessink | last post by:
Hi list, First of all, I wish you all a happy 2006. I have a small question that googling didn't turn up an answer for. So hopefully you'll be kind enough to send me in the right direction. ...
5
by: Doc | last post by:
Hello! I'm experiencing a little problem counting the number of characters in a textarea on a html page. This is the content type of my HTML document content="text/html; charset=iso-8859-1" ...
26
by: libsfan01 | last post by:
Hi all! Can anyone show me how to check and email field on a form for the existence of these two characters. Kind regards Marc
7
by: JJ | last post by:
To validate a password as the user is registering I want to use a regular expressio validator. I got this one from the Microsoft web site for validating a password of at least 7 characters, with...
13
by: preport | last post by:
I'm trying to ensure that all the characters in my XML document are characters specified in this document: http://www.w3.org/TR/2000/REC-xml-20001006#charsets Would a function like this work: ...
4
by: bitshift | last post by:
Im pulling a string out of a text field in sql and into a byte array in my C# code. Help frefresh my memory here, a single asci character is 1 byte correct ? So why is a string that is 37...
11
by: Bryan Crouse | last post by:
I am looking a way to do error checking on a string at compile time, and if the string isn't the correct length have then have the compiler throw an error. I am working an embedded software that...
7
by: quest313 | last post by:
When typing in text fields in my web page I noticed random keystrokes are occasionally skipped (ignored). You sometimes have to type a while before it happens. I traced this down to a function...
2
by: madhuriks | last post by:
hi, i had done validation in my project...my prob. is if i enter 'AM98' in txtfield it is taking....but it should not take..it has to take 'MA98'...here with i m sending the code...can anyone...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.