ciao,
io mi affiderei ad una funzione javascript che utilizza regex, qualcosa tipo:
<script type="text/javascript" language="javascript" >
function SoloNumeri(e)
{
var keynum;
var checker = new RegExp("\\d|[.,]");
if(window.event) // IE
{
keynum = e.keyCode;
window.event.returnValue = checker.test(String.fromCharCode(keynum));
}
else if(e.which)
{
// Netscape/Firefox/Opera
keynum = e.which;
if(keynum == 8) //--- back o spazio
return true;
else
return checker.test(String.fromCharCode(keynum));
}
}
</script>
<input id="pp" onkeypress="SoloNumeri(event)" />
questa impedisce l'inserimento di caratteri che non siano numerici nella textbox, la tua' sara "tarata" sulla serie di caratteri che non vuoi siano digitati, qualcosa come:
var checker = new RegExp("[^&*@]");
etc... insomma i caratteri che nn vuoi preceduti dal "^" che vuol dire "not"...
ciao.
Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo