diff --git a/src/modules/behavior/form.js b/src/modules/behavior/form.js index ec52708fe..f523b750b 100755 --- a/src/modules/behavior/form.js +++ b/src/modules/behavior/form.js @@ -360,7 +360,7 @@ $.fn.form = function(fields, parameters) { var $field = module.get.field(field.identifier), type = validation.type, - value = $field.val(), + value = $field.val() + '', bracketRegExp = /\[(.*?)\]/i, bracket = bracketRegExp.exec(type), @@ -370,7 +370,7 @@ $.fn.form = function(fields, parameters) { ; // if bracket notation is used, pass in extra parameters if(bracket !== undefined && bracket !== null) { - ancillary = bracket[1]; + ancillary = '' + bracket[1]; functionType = type.replace(bracket[0], ''); isValid = $.proxy(settings.rules[functionType], $module)(value, ancillary); } @@ -652,6 +652,7 @@ $.fn.form.settings = { return (value != notValue); }, contains: function(value, text) { + text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); return (value.search(text) !== -1); }, is: function(value, text) {