jQWidgets Forums

jQuery UI Widgets Forums Form Homepage Redirect after Successful Login

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 5 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • rnovelo
    Participant

    Hello,
    I am using the login form provided by jqwidgets, but how can I redirect to the homepage after a successful login? What additional code do I need to add? I’m using the original code.

    
    <script type="text/javascript">
            $(document).ready(function () {
                
                $("#username, #password").addClass('jqx-input');
                if (theme != '') {
                    $("#username, #password").addClass('jqx-input-' + theme);
                }
                $("#rememberme").jqxCheckBox({ width: 130});
                $("#loginButton").jqxButton({theme: theme});
    
                // add validation rules.
                $('#form').jqxValidator({
                    rules: [
                           { input: '#username', message: 'Username is required!', action: 'keyup, blur', rule: 'required' },
                           { input: '#username', message: 'Your username must start with a letter!', action: 'keyup, blur', rule: 'startWithLetter' },
                           { input: '#username', message: 'Your username must be between 3 and 12 characters!', action: 'keyup, blur', rule: 'length=3,12' },
                           { input: '#password', message: 'Password is required!', action: 'keyup, blur', rule: 'required' },
                           { input: '#password', message: 'Your password must be between 4 and 12 characters!', action: 'keyup, blur', rule: 'length=4,12' }
                    ]
                           
                });
                // validate form.
                $("#loginButton").click(function () {
                    $('#form').jqxValidator('validate');
                });
    
                $("#form").on('validationSuccess', function () {
                    $("#form-iframe").fadeIn('fast');
                });
            });
        </script>
    
    Homepage Redirect after Successful Login #107161

    Hristo
    Participant

    Hello rnovelo,

    You could choose suitable for you approach.
    The jqxValidator has validationSuccess” event if all fields are typed correctly then this event is fired.
    Please, take a look at this demo:
    https://www.jqwidgets.com/jquery-widgets-demo/demos/interactivedemos/ticketingsystem/
    It is part of the Showcase” demos section.
    The whole source code of this and the other demos you could find in the download package.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.