summaryrefslogtreecommitdiffhomepage
path: root/libs/web/htdocs
diff options
context:
space:
mode:
Diffstat (limited to 'libs/web/htdocs')
-rw-r--r--libs/web/htdocs/luci-static/resources/cbi.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js
index 3959b6937f..992b5588ee 100644
--- a/libs/web/htdocs/luci-static/resources/cbi.js
+++ b/libs/web/htdocs/luci-static/resources/cbi.js
@@ -27,6 +27,16 @@ var cbi_validators = {
return (cbi_validators.integer(v) && (v >= 0));
},
+ 'float': function(v)
+ {
+ return !isNaN(parseFloat(v));
+ },
+
+ 'ufloat': function(v)
+ {
+ return (cbi_validators['float'](v) && (v >= 0));
+ },
+
'ipaddr': function(v)
{
return cbi_validators.ip4addr(v) || cbi_validators.ip6addr(v);