mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Numeric validator that accepts blank should accept undefined
This commit is contained in:
parent
ddb2ea4b5f
commit
4affbb8c6b
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
RED.validators = {
|
RED.validators = {
|
||||||
number: function(blankAllowed){return function(v) { return (blankAllowed&&v==='') || (v!=='' && !isNaN(v));}},
|
number: function(blankAllowed){return function(v) { return (blankAllowed&&(v===''||v===undefined)) || (v!=='' && !isNaN(v));}},
|
||||||
regex: function(re){return function(v) { return re.test(v);}},
|
regex: function(re){return function(v) { return re.test(v);}},
|
||||||
typedInput: function(ptypeName,isConfig) { return function(v) {
|
typedInput: function(ptypeName,isConfig) { return function(v) {
|
||||||
var ptype = $("#node-"+(isConfig?"config-":"")+"input-"+ptypeName).val() || this[ptypeName];
|
var ptype = $("#node-"+(isConfig?"config-":"")+"input-"+ptypeName).val() || this[ptypeName];
|
||||||
|
Loading…
Reference in New Issue
Block a user