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 19401940 } ) ;
19411941 } ) ;
19421942
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+ }
19551959 } ,
19561960
19571961 /**
You can’t perform that action at this time.
0 commit comments