Ja vi kunne lave en input-maske, som kun accepterer 0-7:
<html><head>
<TITLE>Validering kun eet tal 0-7</TITLE>
<META NAME="keywords" CONTENT="roenving;
http://www.eksperten.dk/spm/366902"><META NAME="Generator" CONTENT="Stone's WebWriter 3.5">
<script LANGUAGE="javascript" TYPE="text/javascript">
var newVal="";
var repeatRemove=0;
function getCharCode(e){
return (e.which)?e.which:e.keyCode;
}
function restoreVal(eC,fld){
if (eC==8||repeatRemove>0){
if (newVal.length>repeatRemove){
newVal=newVal.substring(0,newVal.length-repeatRemove)
}else{
newVal="";
}
}
repeatRemove=0;
fld.value=newVal;
}
function inputTal(e,fld){
removeChar=false;
newVal=fld.value;
charCode = getCharCode(e);
if (fld.value.length>0 || charCode>55 || charCode<48){
return false;
}
newVal=String.fromCharCode(charCode)
return true;
}
</SCRIPT>
</HEAD>
<BODY>
<form>
<INPUT type="text" name="date" value="" onkeydown="if(getCharCode(event)==8)repeatRemove++;" onkeypress="return inputTal(event,this);" onkeyup="restoreVal(getCharCode(event),this);this.focus();">
</FORM>
</body>
</HTML>