libs/web: implement new phone digit datatype, useful for VoIP related config screens

This commit is contained in:
Jo-Philipp Wich 2012-02-14 15:16:53 +00:00
parent cd4e008cc1
commit 63a75c6ea9
2 changed files with 8 additions and 0 deletions

View file

@ -269,6 +269,10 @@ var cbi_validators = {
return false;
return true;
},
'phonedigit': function()
{
return (this.match(/^[0-9\*#]+$/) != null);
}
};

View file

@ -305,3 +305,7 @@ function max(val, max)
return false
end
function ponedigit(val)
return (val:match("^[0-9\*#]+$") ~= nil)
end