ciao
io utilizzo questa funzione Javascript scritta da me, nei programmi ASP...
puoi levare o mettere i car. che vuoi nella string
ti do anche la chiamata nella inputtext
naturalmente il nome della function la puoi chiamare come ti pare....
codice:
function CharEmail(myfield, e, dec) {
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
return true;
// numbers
else if ((("abcdefghilmnopqrstuvzwxyjkABCDEFGHILMNOPQRSTUVZWXYK0123456789.@-_").indexOf(keychar) > -1))
return true;
else
return false;
}
...
campo input...
<input name="email" type="text" id="email"
value="<%=lcase(email)%>" onKeyPress="return CharEmail(this, event)" />
...
ciao