Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login form ajax #59

Open
deathrace37 opened this issue Jul 2, 2017 · 1 comment
Open

login form ajax #59

deathrace37 opened this issue Jul 2, 2017 · 1 comment
Labels

Comments

@deathrace37
Copy link

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.

@selimgnaoui
Copy link

selimgnaoui commented Nov 14, 2017

@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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants