modular-admin-html icon indicating copy to clipboard operation
modular-admin-html copied to clipboard

login form ajax

Open deathrace37 opened this issue 8 years ago • 1 comments

Sorry, i'm french and my english is verry bad. I want to using ajax : `var dataString = $('#login-form').serialize(); // Collect data from form $.ajax({ type: "POST", url: $('#login-form').attr('action'), data: dataString, timeout: 6000, error: function (request, error) {

            },
            success: function (response) {
                response = $.parseJSON(response);
               if (response.success) {
                    alert('ok');
                 } 
               
            }
            
            
        });
        return false;`

But I do not know how. Please help me.

deathrace37 avatar Jul 02 '17 12:07 deathrace37

@modularcoder
the login-function should be done on the server side. Server will get the dataString, check if the login and the password are correct, then will return an Object/array "response" that should contain a Field "success" having the value 0 or 1 .

selimgnaoui avatar Nov 14 '17 14:11 selimgnaoui