Menu
Hello guys
i need validate this format ###-####### (where # is a number of course)
like
123-1234567
001-5469898
when the user fills the field
the point is i have this and doesnt work yet
[CODE]
function numerofacturacontrol(e,str){
var key = window.event ? e.keyCode : e.which;
if((key==null) //null
|| (key==0) //null
|| (key==8) //backspace
|| (key==9) //horizontal tab
//|| (key==13) //enter
|| (key==27) //scape
) return true;
var myregex = new [b]RegExp(“^(\d{3,3})+(-{1,1})?(\d{7,7})?$[/b]”,”g”);
return myregex.test(str + String.fromCharCode(key));
}
how i can resolve this?
thanks for advanced