简体   繁体   English

带有ASP Classic的JQUERY AJAX登录表单

[英]JQUERY AJAX Login Form with ASP Classic

I have a modal menu that I'm using as a login form that has input for the username and password utilizing JQUERY AJAX methods seen here: 我有一个模式菜单,该菜单用作登录表单,该表单使用JQUERY AJAX方法输入了用户名和密码,如下所示:

function ajaxSubmit(){
        $.post("verify.asp",$("#Form-Submit").serialize());
        $("#Modal-Menu-Status").load("verify.asp");
    };

I'm trying to submit the data that was put into the form, process it to verify.asp which outputs a login status(Logged In, Incorrect Information), and then get that status back to my menu. 我正在尝试提交放入表单的数据,将其处理为verify.asp,它输出登录状态(“登录”,“错误信息”),然后将该状态返回到我的菜单。

It's loading my verify.asp info into the menu, but it always comes back as "Incorrect information". 它将我的verify.asp信息加载到菜单中,但始终以“错误信息”形式返回。 Its not processing any information from the serialize data how can I communicate properly with this page? 它不处理序列化数据中的任何信息,如何与该页面正确通信? Any help would be greatly appreciated. 任何帮助将不胜感激。 Thanks! 谢谢!

You're actually creating two separate requests to verify.asp. 您实际上是在创建两个单独的请求verify.asp。 The first one sends the form data correctly, but its response is ignored. 第一个正确发送表单数据,但其响应将被忽略。 On the second one you do get the response onto #Modal-Menu-Status , but there isn't any parameter being sent, so that "incorrect information" is being returned. 在第二个上,您确实获得了对#Modal-Menu-Status的响应,但是没有发送任何参数,因此将返回“不正确的信息”。

You should use JQuery's ajax() method: 您应该使用JQuery的ajax()方法:

function ajaxSubmit(){
    $.ajax({
        url: "verify.asp",
        data: $("#Form-Submit").serialize(),
        method: "POST",
        success: function(response){
            $("#Modal-Menu-Status").html(response);
        }
    });
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM