angiras
04-26-2003, 12:30 PM
I have found here this very good script :
var lettres="abcdefghijklmnopqrstuvwxyzABCDEFRHIJKLMNOPQRSTUVWXYZ";
var nombres="1234567890";
var nombresPoint="1234567890.";
function alpha(e,allow)
{
var k;
k=document.all?parseInt(e.keyCode): parseInt(e.which);
return (allow.indexOf(String.fromCharCode(k))!=-1);
}
I call it
<input type="text" id="nb" onkeypress="return alpha(event,nombres)"/>
how can I use regular expression with it
email adress or any ?
thank you
var lettres="abcdefghijklmnopqrstuvwxyzABCDEFRHIJKLMNOPQRSTUVWXYZ";
var nombres="1234567890";
var nombresPoint="1234567890.";
function alpha(e,allow)
{
var k;
k=document.all?parseInt(e.keyCode): parseInt(e.which);
return (allow.indexOf(String.fromCharCode(k))!=-1);
}
I call it
<input type="text" id="nb" onkeypress="return alpha(event,nombres)"/>
how can I use regular expression with it
email adress or any ?
thank you