File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change 1940
1940
} ) ;
1941
1941
} ) ;
1942
1942
1943
- /**
1944
- * Before submitting the actual form, remove the previously assigned indices
1945
- * @param {Object } form
1946
- */
1947
- this . options . submitHandler = function ( form ) {
1948
- originalElements . forEach ( function ( element ) {
1949
- element . element . attr ( 'name' , element . name ) ;
1950
- element . element . removeAttr ( 'orig-name' ) ;
1951
- } ) ;
1952
- /* Call the originalSubmitHandler if it's a function */
1953
- typeof originalSubmitHandler === 'function' ? originalSubmitHandler ( form ) : void ( 0 ) ;
1954
- } ;
1943
+ if ( originalElements . length ) {
1944
+ /**
1945
+ * Before submitting the actual form, remove the previously assigned indices
1946
+ * @param {Object } form
1947
+ */
1948
+ this . options . submitHandler = function ( form , event ) {
1949
+ originalElements . forEach ( function ( element ) {
1950
+ element . element . attr ( 'name' , element . name ) ;
1951
+ element . element . removeAttr ( 'orig-name' ) ;
1952
+ } ) ;
1953
+
1954
+ console . error ( this . submit )
1955
+ /* Call the originalSubmitHandler if it's a function */
1956
+ typeof originalSubmitHandler === 'function' ? originalSubmitHandler ( form ) : form . submit ( ) ;
1957
+ } ;
1958
+ }
1955
1959
} ,
1956
1960
1957
1961
/**
You can’t perform that action at this time.
0 commit comments