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

Error in script - testing if a field has a non character

2
I am creating a script that may check if a field has a non character and if yes it may appears an error message after I move to the next field.

When I use this script in PL/SQL (...v_enabled||' onBlur ="chkString(this)"')
I receive the error: runtime error, object expected.
Can you tell me why this error is happening, please?

geralp.p('<script language="JavaScript">
function chkstring(p_campo)
{
var value = (p_campo.value).toUppercase();
var letras = ''AÁÀÃÂÄBCÇDEÉÈÊËFGHIÍÌÎÏJKLMNOÓÒÔÖPQRSTUÚÙÛÜVWXYÝ Z '';

for(i=0;i<value.length;i++)
{
var carct=value.charAt(i);

if(letras.indexOf(carct)==-1)
{
alert(''teste: ''+carct);
p_campo.value="";
p_campo.focus();
return false;
}

}

return true;
}
</script>
'
);



Thanks,
Denize
May 18 '07 #1
3 1332
acoder
16,027 Expert Mod 8TB
By non-character, you mean anything besides the characters in the 'letras' string?
May 21 '07 #2
Denize
2
Exactly. I have a field in a form that can accept only the characters in the string letras.

Thanks in advance,
Denize


By non-character, you mean anything besides the characters in the 'letras' string?
May 22 '07 #3
acoder
16,027 Expert Mod 8TB
Then you should use regular expressions - see link.
May 22 '07 #4

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

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
1
by: AA Arens | last post by:
To have the first character of a fiels capitalized AfterUppdate, I used the following script: Me!City = UCase$(Left$(Me!City, 1)) + Mid$(Me!City, 2) UCase (Left(Me!City, 1)) + Mid(Me!City, 2) ...
18
by: William | last post by:
I have the following javascript function that updates a scroll_list and sends the updated entry (with its index) to a server script ( i.e. http://mkmxg00/cgi/confirmUpload.pl ) for further...
39
by: eruanion | last post by:
Hi, I've been working on this for a while now and I can't seem to find out what is wrong with my code. I have 2 files one c3common.js which only contains javascript functions for my main html page...
1
by: Eric | last post by:
When I run my script it gives error on the following line: strEmail = Right(strEmail, (Len(strEmail) - 1)) I enclose my code and the sample text file too Thanks,...
1
by: jamesdylangoldstein | last post by:
So I tried to do my father a favor and convert his advertisements to .flv and place them on his website. With Flash being $600, I found an open-source .flv player and configured it. So today he...
13
by: problem. | last post by:
#include <stdio.h> #include <stdlib.h> int main(void) { int a, b; float result = 0.0f; char symbol = '\0'; int loop = 0;
14
by: kigoobe | last post by:
Well guys, I have tested a script that's working well in FF, however while testing with IE7, I am finding errors. That famous yellow warning icon at the left of our status bar. Basically, I am...
4
by: Chronictank | last post by:
Hi, as a bit of background (and seeing as it is my first post :)) i am a complete newbie at perl. I literally picked it up a week ago to do this project as it seemed like the best choice for a...
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...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.