如何验证表单,然后将值传递到“谢谢”页面并显示“谢谢”页面

时间:2020-08-03 16:37:49

标签: jquery ajax forms validation

我需要验证此表单并将值发送到新页面并显示带有值的新页面。 表单验证有效,并且网络状态显示为200,但是新页面的符号为meuptemp2 / 无法加载,也不会显示错误。

我整夜忙于搜寻互联网,无法弄清为什么signmeuptemp2 /无法加载并显示值。

<script type = "text/javascript" >
    function submitted() {
        theButton = document.getElementById("submitbutton");
        theButton.disabled = "disabled";
        theButton.value = "Please Wait...";
} 
</script>

<div id = "progress">Please wait... </div></div></div>

<!-- Bootstrap validator -->
<script type = "text/javascript">
    $(document).ready(function () {
        $('#register-form').bootstrapValidator({
            container: '#messages',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                password: {
                    validators: {
                        notEmpty: {
                            message: '<p>first password isrequired'
                        },
                        stringLength: {
                            min: 4,
                            max: 30,
                            message: 'Your  password must be more than 4 and less than 10 characters long111111111'
                        }
                    }
                },

                passwordchek: {
                    validators: {
                        identical: {
                            field: 'password',
                            message: 'Both passwords must match!'
                        },
                        notEmpty: {
                            message: '<p>second password isrequired'
                        },
                        stringLength: {
                            min: 4,
                            max: 30,
                            message: '<p>Your  password must be more than 4 and less than 10 characters long'
                        }
                    }
                },
                captchaa: {
                    validators: {
                        notEmpty: {
                            message: '<p>code is required'
                        },
                        stringLength: {
                            min: 4,
                            max: 30,
                            message: '<p>the code must be more than 4 and less than 10 characters long'
                        },
                    }
                },
            },

            // https://stackoverflow.com/questions/46356529/firefox-displaying-form-data-in-url-upon-jquery-ajax-post
            submitHandler: function (form) {
                $.ajax({
                    type: 'POST',
                    cache: 'false',
                    url: 'signmeuptemp2/',
                    data: $("#register-form").serialize(),
                    success: function (data, status) {
                        alert(data);
                    }
                });
            }
        });
    }); 
</script>
<script type = "text/javascript" language = "JAVASCRIPT" src = "//cdnjs.cloudflare.com/ajax/libs/bootstrap-validator/0.4.5/js/bootstrapvalidator.min.js"></script>
 

0 个答案:

没有答案
相关问题