简体   繁体   中英

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:

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.

It's loading my verify.asp info into the menu, but it always comes back as "Incorrect information". 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. 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.

You should use JQuery's ajax() method:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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