libs/web: introduce "uciname" datatype for cbi validation
This commit is contained in:
parent
fc5b9e27f0
commit
4622241535
2 changed files with 8 additions and 0 deletions
|
@ -152,6 +152,10 @@ var cbi_validators = {
|
||||||
return (v.length == 5) || (v.length == 13);
|
return (v.length == 5) || (v.length == 13);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'uciname': function(v)
|
||||||
|
{
|
||||||
|
return (v.match(/^[a-zA-Z0-9_]+$/) != null);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -204,3 +204,7 @@ function device( val, seen )
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function uciname(val)
|
||||||
|
return (val:match("^[a-zA-Z0-9_]+$") != nil)
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue