jQuery UI Widgets Forums Dialogs and Notifications Window Login Dialog Window

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 8 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Login Dialog Window #89655

    walker1234
    Participant

    So I was trying the login dialog mentioned here.For some reason, after pressing the login button it keeps on adding ?page=login even though I am not using action attribute in my HTML as shown below. Am I doing something wrong in Ajax POST call?

    Here is my HTML:

    
    <!-- Login HTML Begins -->
                <div id="wrap">
    
                <div id="window" caption="Login">
                    <div>
                        <form >
                            <table>
                                <tr>
                                    <td>Username:</td>
                                    <td><input style="width: 150px;" type="text" name="user" id = "username" /></td>
                                </tr>
                                <tr>
                                    <td>Password:</td>
                                    <td><input style="width: 150px;" type="password" name="password" id = "password" /></td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="right" valign="bottom">
                                        <input type="submit" id="submit" value="Login" />
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
    
                <!-- Login HTML ends -->

    Here is my Javascript Code:

    
    <script type="text/javascript">
        $(document).ready(function () {
            $('#window').jqxWindow({ theme: "shinyblack", width: 250, height: 130, isModal: true });
            $('#submit').jqxButton({ theme: "shinyblack" });
    
          var loginUrl = "https://abc.com:8443/Webservice/loginCheck"
    
     $( "#submit" ).click(function() {
    
                    var userName = $("#username").val();
                     var passWord = $("#password").val();
    
                    var ajaxRequest = jQuery.ajax({
                        //beforeSend: TODO: show spinner!
                        data: {
                            username: userName,
                            passWord: passWord 
                        },
                        dataType: "json",
                        method: "POST",
                        url: loginUrl
                    })
                     .done(function (data_, textStatus_, jqXHR_) {
    
                    // Validate the web service and retrieve the status.
                    if (typeof (data_) === "undefined" || data_ === null) { alert("Invalid data returned from LoginCheck Web Service"); return false; }
                    if (isEmpty(data_.webservice_status) || isEmpty(data_.webservice_status.status)) { alert("Invalid Web Service Status for LoginCheck Webservice!"); return false; }
                    if (data_.webservice_status.status != "SUCCESS") {   alert(data_.webservice_status.message); 
    
                    return false; }
                })
    
               .fail(function (jqXHR_, textStatus_, errorThrown_) {
                        alert("Hitting the Fail function : Error in LoginCheck webservice: " + errorThrown_);
                        return false;
                    });
    
    }
    
        });
    </script>
    
    Login Dialog Window #89692

    Hristo
    Participant

    Hello walker1234,

    I can`t see wherever to try to load a new page.
    Please, take a look at this demo:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/interactivedemos/ticketingsystem/

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Login Dialog Window #89706

    walker1234
    Participant

    Thanks. Please ignore my previous post. That was some webservic issue I found. One more question. In your demo also, I don’t see the submit button working with the keyboard’s Enter button. I have to specifically click using mouse and then only it works. It’s the same thing with above login dialog as well.

    Login Dialog Window #89765

    Hristo
    Participant

    Hello walker1234,

    You could customize this example or create a new one with wanted settings.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.