Browse Source

#2629 Throw error when identifier is a non-string value

pull/2095/merge
jlukic 9 years ago
parent
commit
b756bb52fe
2 changed files with 8 additions and 3 deletions
  1. 1
      RELEASE-NOTES.md
  2. 10
      src/definitions/behaviors/form.js

1
RELEASE-NOTES.md

@ -11,6 +11,7 @@
- **Segment* - `horizontal segments` in IE will no longer stretch to the natural width of child imgs #2550 [flexbug #1](https://github.com/philipwalton/flexbugs#1-minimum-content-sizing-of-flex-items-not-honored)
- **Sticky** - Fixed `sticky` element that cannot fit in viewport not scrolling correctly when fixed to viewport #2605
- **Form** - Fixed issue with `minLength[1]` validation not behaving same as `minLength > 2` #2636.
- **Form** - Form fields will now error when a non-string identifier is used
**Additional Bugs**
- **Popup** - `wide` and `very wide` popup will now limit themselves to normal popup widths on mobile so that they still appear on screen.

10
src/definitions/behaviors/form.js

@ -495,6 +495,9 @@ $.fn.form = function(parameters) {
field: function(identifier) {
module.verbose('Checking for existence of a field with identifier', identifier);
if(typeof identifier !== 'string') {
module.error(error.identifier, identifier);
}
if( $field.filter('#' + identifier).length > 0 ) {
return true;
}
@ -1017,9 +1020,10 @@ $.fn.form.settings = {
},
error: {
oldSyntax : 'Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically.',
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.',
identifier : 'You must specify a string identifier for each field',
noRule : 'There is no rule matching the one you specified',
method : 'The method you called is not defined.'
},
templates: {

Loading…
Cancel
Save