Zoo Visitor

User guide

AJAX loginΒΆ



                <!--using the jQuery Form plugin http://jquery.malsup.com/form/-->
                <script src="http://malsup.github.com/jquery.form.js" type="text/javascript"></script>

                <script type="text/javascript">
                                        dataType: 'json',
                                        success: function(data) {
                                                if (data.success) {
                                                        alert('You are now logged in. You can add additional actions in the js script.');
                                                } else {
                                                        alert('Failed with the following errors: '+data.errors.login);



        <h2>Account - AJAX login</h2>

        {exp:visitor:login_form id="loginForm" json="yes"}

                Email: <input id="username" name="username" type="text" />

                Password: <input id="password" name="password" type="password" />

                {if auto_login}
                Remember me? <input class="checkbox" name="auto_login" type="checkbox" value="1" />

                <input name="submit" type="submit" value="Log in" />