?
Solved

check caracter with accent

Posted on 2005-03-11
8
Medium Priority
?
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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

743 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