|
@ -988,10 +988,12 @@ $.fn.form.settings = { |
|
|
|
|
|
|
|
|
regExp: { |
|
|
regExp: { |
|
|
bracket : /\[(.*)\]/i, |
|
|
bracket : /\[(.*)\]/i, |
|
|
escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, |
|
|
|
|
|
|
|
|
decimal : /^\-?\d*(\.\d+)?$/, |
|
|
email : "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", |
|
|
email : "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", |
|
|
integer : /^\-?\d+$/, |
|
|
|
|
|
|
|
|
escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, |
|
|
flags : /^\/(.*)\/(.*)?/, |
|
|
flags : /^\/(.*)\/(.*)?/, |
|
|
|
|
|
integer : /^\-?\d+$/, |
|
|
|
|
|
number : /^\-?\d*(\.\d+)?$/, |
|
|
url : /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i |
|
|
url : /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -1018,10 +1020,10 @@ $.fn.form.settings = { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
error: { |
|
|
error: { |
|
|
oldSyntax : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.', |
|
|
|
|
|
identifier : 'You must specify a string identifier for each field', |
|
|
identifier : 'You must specify a string identifier for each field', |
|
|
|
|
|
method : 'The method you called is not defined.', |
|
|
noRule : 'There is no rule matching the one you specified', |
|
|
noRule : 'There is no rule matching the one you specified', |
|
|
method : 'The method you called is not defined.' |
|
|
|
|
|
|
|
|
oldSyntax : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
templates: { |
|
|
templates: { |
|
@ -1124,6 +1126,15 @@ $.fn.form.settings = { |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// is valid number (with decimal)
|
|
|
|
|
|
decimal: function(value) { |
|
|
|
|
|
return $.fn.form.settings.regExp.decimal.test(value); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// is valid number
|
|
|
|
|
|
number: function(value) { |
|
|
|
|
|
return $.fn.form.settings.regExp.number.test(value); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// is value (case insensitive)
|
|
|
// is value (case insensitive)
|
|
|
is: function(value, text) { |
|
|
is: function(value, text) { |
|
|