Friday, August 14, 2009

Javascript function to allow only alphabets (lower and upper case).


function AllowCharacterOnly(myevent)
{
var Val = (myevent.which) ? myevent.which : myevent.keyCode
if ((Val > 64 && Val < 91) || (Val > 96 && Val < 123))
{
return true;
}
return false;

}


input type="text" id=txtChracter onkeypress="return AllowCharacterOnly(event)"

1 comment:

Unknown said...

Nice posts jyoti. it shows your experience in web development.

i found some posts very useful for me so i took some posts and added it to my blog. I hope you don't mind.

please also look at my blog

http://niksgaur.blogspot.cpm