Ajax Login Form - Browsers Will Not Save Password

I have an Ajax login form that validates the credentials given and redirects to another page. The login form itself is created by calling HXR - it is not embedded in the login page code.

The problem is that I cannot get browsers to request passwords. As soon as I have Firefox, but since the form is created by calling XHR, Firefox did not insert the value into the form.

PS. I use mootools (Form.send) and regular window.location when the login was successful. Pss. The login page address is always the same.

The following code is loaded by XHR inside the element (I use MochaUI): JavaScript:

$('loginwindow_form').set('send', {
    "url": "auth/ajax_login",
    "method": "post",
    "onRequest": function () {
        $("loginWindow_spinner").show();
    },
    "onComplete": function (response) {
        $("loginWindow_spinner").hide();
    },
    "onSuccess": function (responseText, responseXML) {
        window.location = "appinit";
    },
    "onFailure": function (xhr) {
        MUI.notification('onFailure');
    }
});

$("loginwindow_form").addEvent("submit", function (e) {
    !e || e.stop();
    $('loginwindow_form').send();
});

xHTML ( , - onclick ID):

<iframe src="auth/blank" id="blankiframe" name="blankiframe" style="display:none"></iframe>
<form action="appinit" method="post" name="loginwindow_form" id="loginwindow_form" class="standardform" target="blankiframe">
    <input type="text" name="email" class="input text" id="loginwindow_form_email" />
    <input type="password" name="password" class="input text password" id="loginwindow_form_loginwindow_form_password" />
</form>

( , xhr, ):

<button class="button" action="{sendForm: 'loginwindow_form'}">
    <div class="accept">Login</div>
</button>
+3
2

, sumbit, iframe. ( iframe). , JS iframe, , , .

+1

. .send , . , , .

, submit, , , , , , event.stop .preventDefault?

+2

Source: https://habr.com/ru/post/1796347/


All Articles