我有这个按键功能,只允许数字和“/”我想添加到它的退格键。有人有想法吗?
function OnKeyPressNumberText(sender, eventArgs)
{
var char = eventArgs.get_keyCharacter();
//will allow just letters and "-"
var exp = /[^0-9/]/g;
if (exp.test(char)) {
eventArgs.set_cancel(true);
}
}