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

how to include " in my validation script

I wrote this function to validate the name.
//test name for illegal characters
var illegal = "0123456789!@#$%^&*()-=_+[]\{}|;':,./?><";
for (var i=0;i<strng.length;i++) {
temp = strng.substring(i,i+1);

if (illegal.indexOf(temp) != -1 && strng != "")

{
error = "The name contains illegal characters.\n";
}

How can I include " character in my 'illegal' string.
Are there any other ways to tell string 'illegal' to include only letters.

I am not familiar with this.
If you know any links plesase give it to me.

Thanks
Jul 20 '05 #1
2 2405
VK
function validate (thisString) {
var re = /[^A-Za-z]/g; // creating a regular expression
if (re.test(thisString)) {
error = "The name contains illegal characters.";
}
else {
// everything's fine
}
}

Bartosz Wegrzyn <bl*******@lexon.ws> wrote in message
news:gQ*******************@newssvr28.news.prodigy. com...
I wrote this function to validate the name.
//test name for illegal characters
var illegal = "0123456789!@#$%^&*()-=_+[]\{}|;':,./?><";
for (var i=0;i<strng.length;i++) {
temp = strng.substring(i,i+1);

if (illegal.indexOf(temp) != -1 && strng != "")

{
error = "The name contains illegal characters.\n";
}

How can I include " character in my 'illegal' string.
Are there any other ways to tell string 'illegal' to include only letters.

I am not familiar with this.
If you know any links plesase give it to me.

Thanks

Jul 20 '05 #2
thanks

I found this
http://devedge.netscape.com/library/...p.html#1010922
"VK" <sc**********@yahoo.com> wrote in message
news:3f***********************@news.freenet.de...
function validate (thisString) {
var re = /[^A-Za-z]/g; // creating a regular expression
if (re.test(thisString)) {
error = "The name contains illegal characters.";
}
else {
// everything's fine
}
}

Bartosz Wegrzyn <bl*******@lexon.ws> wrote in message
news:gQ*******************@newssvr28.news.prodigy. com...
I wrote this function to validate the name.
//test name for illegal characters
var illegal = "0123456789!@#$%^&*()-=_+[]\{}|;':,./?><";
for (var i=0;i<strng.length;i++) {
temp = strng.substring(i,i+1);

if (illegal.indexOf(temp) != -1 && strng != "")

{
error = "The name contains illegal characters.\n";
}

How can I include " character in my 'illegal' string.
Are there any other ways to tell string 'illegal' to include only letters.
I am not familiar with this.
If you know any links plesase give it to me.

Thanks


Jul 20 '05 #3

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

Similar topics

43
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is...
8
by: Calan | last post by:
I have a server-side ASP script that dynamically creates an input form from a database table. The table contains a field name, the table where values are stored, type of input control, value for a...
23
by: Loony | last post by:
I have got a code like this in HTML section in ASP file which includes javascript file! The script works under MS IE but doesn't with Firefox! Can anybody tell me what is wrong? <HTML>...
16
by: J. C. Denton | last post by:
I just manually validated alexa's global top 100 sites and find only 2 sites that pass validation. They are http://www.microsoft.com/ http://www.wikipedia.org/ All others should go w3c...
1
by: charliewest | last post by:
Is it possible to use the custom validation control to validate a calendar control via client-side script (in jscript)? I'm familiar with custom validation and client side script, and i am aware...
13
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
28
by: fred.haab | last post by:
Not having server side scripting, I've been doing this for "last modified" tags on my pages: <div class="modified"> <script type="Text/JavaScript"> <!-- document.write("This page was last...
3
by: Martin | last post by:
Hi, I have an aspx page with two dropdownlist controls. I update the options in the second ddl based on selection made in the first. I do this with the ICallbackEventHandler interface, as per...
3
by: mdfidahussain | last post by:
Hello VB Experts, I've encountered an error -> "SWbemServicesEx: Quota Validation" while executing a VB Script, infact the script is simple and is also running fine for many servers but only...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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...
0
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...
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...

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.