Skip to content

Commit 882225c

Browse files
committed
add beforeFormUnbind callback, fix #372
1 parent 887ee0a commit 882225c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ beforeSubmit: function(arr, $form, options) {
105105
}
106106
````
107107

108+
### beforeFormUnbind
109+
Callback function invoked before form events unbind and bind again. Provides an opportunity to manipulate the form before events will be remounted. The callback is invoked with two arguments: the jQuery wrapped form object and the options object.
110+
111+
````javascript
112+
beforeFormUnbind: function($form, options) {
113+
// your callback code
114+
}
115+
````
116+
108117
### filtering
109118
Callback function invoked before processing fields. This provides a way to filter elements.
110119

src/jquery.form.js

+4
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,10 @@
10121012
return this;
10131013
}
10141014

1015+
if (options.beforeFormUnbind) {
1016+
options.beforeFormUnbind(this, options)
1017+
}
1018+
10151019
return this.ajaxFormUnbind()
10161020
.on('submit.form-plugin', options, doAjaxSubmit)
10171021
.on('click.form-plugin', options, captureSubmittingElement);

0 commit comments

Comments
 (0)