473,320 Members | 1,724 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.

vaildating mixed numeric text string

How would I go about validating multiple textfields within the same
form to ensure they start with either 1 or 2 numerical digits (from 8
to 14) followed by 2 or 3 text characters eg. 8MN and 14ABC being
acceptable?

Thanks for the help!

Chris
Jul 20 '05 #1
1 1975
ch***********@hotmail.com (Chris) writes:
How would I go about validating multiple textfields within the same
form to ensure they start with either 1 or 2 numerical digits (from 8
to 14) followed by 2 or 3 text characters eg. 8MN and 14ABC being
acceptable?


Try this regular expression
var re = /^([89]|1[0-4])[A-Z]{2,3}$/;

You can test a field value against it:
if (!re.test(fieldRef.value)) {
// do error handling
}

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: entoone | last post by:
I have a field called pword, whenever someone enters anything but numeric, i.e. mixed alpha with numeric, or even just alpha.. the following error appears. Warning: mysql_numrows(): supplied...
0
by: Swaroop Kumar | last post by:
Hi: I'm trying to write a schema that contains information as described below: 1. The first element is a mandatory fixed string. 2. The second element is a mixed content element that can...
2
by: Mike C | last post by:
I have a fairly simple database of registered voters in a county. The Field for a voters Apartment; RES_APT contains about 85% numeric ("110", "325", "1144", etc etc) and the other 15% is either...
7
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34...
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
2
by: Scott M. Lyon | last post by:
I currently am working on a VB.NET application that imports data from an Excel spreadsheet that the customer filled in. I used the following code to use ODBC to read the data from the...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
5
by: kelvin.koogan | last post by:
I want to declare an array of constant strings. In unmanaged C++ I'd do this static const char *string = { "One", "Two, "Three" }; However if I do this in .NET and want to pass these to a...
9
by: engteng | last post by:
How do I convert string to numeric in VB.NET 2003 ? Example convert P50001 to 50001 or 50001P to 50001 but if P is in middle then not convert. Regards, Tee
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...
0
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...
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: 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)...
1
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.