Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

check caracter with accent

Posted on 2005-03-11
8
Medium Priority
?
377 Views
Last Modified: 2008-03-03
i would like to check my html page with some input field with a javascript.
This Javascript would like to check if people type caracter with accent (èòàùìé) and send a msgbox with caracter not valid....!
It's possible to help me with a source code of example...?
thanks in advance...
Claudio-
0
Comment
Question by:CAVALLOSILF
8 Comments
 

Assisted Solution

by:n01028345
n01028345 earned 150 total points
ID: 13517660
0
 

Author Comment

by:CAVALLOSILF
ID: 13517771
thank!
0
 
LVL 15

Expert Comment

by:justinbillig
ID: 13518437
it doenst even work, it allows !
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:n01028345
ID: 13518545
var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

mikExp = Banned stuff

Lakio
0
 
LVL 31

Assisted Solution

by:GwynforWeb
GwynforWeb earned 600 total points
ID: 13519970
This returns true for valid false for invalid

<script>
function testAccent(val){
return (!/[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿŠŽšž]/.test(val))
}

val='abcdef'
alert(val+' '+testAccent(val))

val='ábcdêf'
alert(val+' '+testAccent(val))

</script>
0
 
LVL 31

Accepted Solution

by:
GwynforWeb earned 600 total points
ID: 13520092
or like this as well

<script>
function testAccent(val){
return (/[ÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿŠŽšž]/.test(val))
}
</script>

<input onblur="if ( testAccent(this.value) ) alert('Invalid!')"><p>

Test samples:-Ãccent ãccênt
0
 
LVL 9

Expert Comment

by:Lakio
ID: 13520579
nice to know and nice script GwynforWeb
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 13520875
thnx :-)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question