Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Double Byte Character "%" validation needed in Javascript

 
Cecil Antony
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Suppose a Double Character "%" is entered in one of the TextField. I need a Javascript Validation. Is it possible from the Javascript?

Please help me in this regard!

Thanks
Cecil.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You question is not clear on what you wanted exactly, but I tried:



Eric
 
Cecil Antony
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

Thanks a lot for your help in this regard. This regards to the double byte which is like charset is UTF-8 and the usage of Japanese/Chinese Keyboard. The "%" in this is different than that we use in regular keyboards.Its of a double byte one.

I'm pasting the simple code for this.

<html<
<script language="Javascript"<
function Check()
{
alert(document.f1.t1.value);
if(document.f1.t1.value.length == 1)
{
if(document.f1.t1.value == "%")
{
alert(document.f1.t1.value.length);
}

}
}

</script<
<body<
<form name="f1" action="" method=""<
<input type="text" name="t1"<
<input type="button" value="Submit";
</form<
</body<
</html<


Please kindly help in this regard!!!

Thanks
Cecil.C.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic