<input type="text" maxlength="2" onkeydown="javascript: return ((event.keyCode>07)&&(event.keyCode<58));>
<input type="text" onkeydown="return specialText(this, event)">
function specialText(element, event)
{
if (
event.keyCode == 69 ||
event.keyCode == 189 ||
element.value.length >= 100
) {
return false;
}
}
<input type="text" maxlength="100" onkeydown="if (event.keyCode == 69 || event.keyCode == 189) return false">
maxlength
и pattern
.<input type="text" pattern="\d{1,2}|100" maxlength="3">