From 05652ab7cdaf937ce5aaecdaabdf898ab4b78dff Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Sun, 15 May 2016 16:47:24 -0400 Subject: [PATCH] Fix destroy never being called before init #3798 --- RELEASE-NOTES.md | 1 + src/definitions/behaviors/form.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c4c80b147..03f77e8f0 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -62,6 +62,7 @@ - **Dropdown** - Seach selection would lose search input focus when clicking on a choice #3790 - **Embed** - `API` setting is now disabled by default - **Form** - Fix `equal width fields` sometimes not including right field spacing on mobile #3913 +- **Form Validation ** - Fixed issue where initializing form multiple times would not properly call `destroy` removing previous settings #3798 - **Form** - Grouped `fields` and `field` would cause different margin collapse, making `fields` include larger gaps between content #3717 - **Form** - Fixed issue where `inline` field was not being correctly inverted in color with `inverted form` #4004 #4005 **Thanks @tbracken** - **Form** - Remove deprecated `size()` method in `prompt` #3655 **Thanks @SimonArdrey** diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index 35f08ac71..286e0fc62 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -81,6 +81,9 @@ $.fn.form = function(parameters) { module.invoke(query); } else { + if(instance !== undefined) { + instance.invoke('destroy'); + } module.verbose('Initializing form validation', $module, settings); module.bindEvents(); module.set.defaults();