0

嗨,我使用基于 ajax 的表单。我的问题是,我不知道如何更改 java 脚本代码以使用提交函数。我想我必须集成到这段代码中document.getElementById("form1").submit(); ,但我不知道如何。我想通过提交功能发送它,因为然后我会显示提交是否发布答案。

   ;(function( $, window, document, undefined ) {

    $(document).ready(function() {

        if( $.fn.wizard ) {

            $( '.wzd-default' ).wizard({
                buttonContainerClass: 'mws-button-row'
            });

            if( $.fn.validate ) {
                $wzd_form = $( '.wzd-validate' ).validate({ onsubmit: false });

                $( '.wzd-validate' ).wizard({
                    buttonContainerClass: 'mws-button-row', 
                    onStepLeave: function(wizard, step) {
                        return $wzd_form.form();
                    }, 
                    onBeforeSubmit: function() {
                        return $wzd_form.form();
                    }
                });

                $wzd_v_form = $( '.wzd-vertical' ).validate({ onsubmit: false });

                $( '.wzd-vertical' ).wizard({
                    orientation: 'vertical', 
                    buttonContainerClass: 'mws-button-row', 
                    onStepLeave: function(wizard, step) {
                        return $wzd_v_form.form();
                    }, 
                    onBeforeSubmit: function() {
                        return $wzd_v_form.form();
                    }
                });

                $wzd_v1_form = $( '.wzd-ajax' ).validate({ onsubmit: false });

                $( '.wzd-ajax' ).wizard({
                    buttonContainerClass: 'mws-button-row', 
                    onStepLeave: function(wizard, step) {
                        return $wzd_v1_form.form();
                    }, 
                    onBeforeSubmit: function() {
                        return $wzd_v1_form.form();
                    }, 


                });
            }           
        }
    });

}) (jQuery, window, document);
4

0 回答 0