You are already passing Textbox Object and Your Predefined Chars to your function. Match the chars there with
key codes[
^]. Try this:
HTML:
<input type="text" id="txt1" class="customChar" önkeypress="return allowChar(this, 'ABC123');" />
JavaScript:
function allowChar(textbox, chars){
var keynum;
if(window.event){
keynum = e.keyCode;
}else
if(e.which){
keynum = e.which;
}
var EnteredWord = String.fromCharCode(keynum);
}
Hope it helps!
--Amit