pokk,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
window.addEventListener("DOMContentLoaded", function() {
var el = document.getElementById("id_Radio_Text");
function check() {
var val = this.value;
val = val.replace(/[^0-9a-f]/gi, "");
val.length > 4 && (val.length = 4);
val != this.value && (this.value = val);
}
el.addEventListener("input", check, false)
}, false);
</script>
</head>
<body>
<input id="id_Radio_Text" name="N_Radio_Text" type="text" maxlength="4">
</body>
</html>