I'm not an experienced
javascript
developer, but I think this will do it:
function numeric(text){
var numeric="1234567890";
if (text.length != 12)
{
alert("invalid length !");
return false;
}
for(var i=0; i < text.length; i++)
{
if (!numeric.includes(text[i]))
{
alert("invalid !");
return false;
}
}
alert("Valid !");
return true;
}