jQuery UI Widgets Forums General Discussions Jqwidgets in IE when published

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Jqwidgets in IE when published #55253

    crooseat
    Participant

    It is working in my local machine when developing in both IE and Firefox. But when it published in the server in don’t work in IE. But in Firefox it work. This is my code. All files are referenced in Main page. When main page page loads following function is called. It don’t validate, and when clicks on login it give error “object does not support this property or method”. I am using windows XP with IE 8.

    function LoginWindow(show) {
        if (show) {
            var LogingWindow = '<div id="logingwindow" >' +
                            '<div>' +
                                '<table id="login">' +
                                    '<tr>' +
                                        '<td><label id="lblUsername">User Name :</label></td>' +
                                        '<td><input type="text" id="txtUserName"/></td>' +
                                    '</tr>' +
                                    '<tr>' +
                                        '<td><label id="lblPassword">Password :</label></td>' +
                                        '<td> <input type="password" id="txtPassword"/></td>' +
                                    '</tr>' +
                                    '<tr>' +
                                        '<td></td>' +
                                        '<td><input type="button" value="Login" id="btnLogin" /><label id="lblError"></td>' +
                                    '</tr>' +
                                '</table>' +
                            '</div>' +
                        '</div>';
            $("#body").append(LogingWindow);
    
            $("#txtUserName").jqxInput({ placeHolder: "User Name", height: 25, width: 200, theme: 'darkblue' });
            $("#txtPassword").jqxInput({ placeHolder: "Password", height: 25, width: 200, theme: 'darkblue' });
            $("#btnLogin").jqxButton({ width: '100', height: 30, theme: 'darkblue' });
            $('#logingwindow').jqxWindow({ title: 'Login', theme: "darkblue", width: 350, height: 150, position: 'center', showCloseButton: false, draggable: false, resizable: false, isModal: true });
    
            // Create jqxValidator.
            $("#logingwindow").jqxValidator({
                rules: [
                            {
                                input: "#txtUserName", message: "*", action: 'keyup, blur', rule: function(input, commit) {
                                    return input.val() != "" && input.val() != "User Name";
                                }
                            },
                            {
                                input: "#txtPassword", message: "*", action: 'keyup, blur', rule: function(input, commit) {
                                    return input.val() != "" && input.val() != "Password";
                                }
                            }
                    ]
            });
    
            $('#btnLogin').on('click', function() {
                var isvalid = $('#logingwindow').jqxValidator('validate');
                if (isvalid) {
                    userName = $("#txtUserName").val();
                    password = $("#txtPassword").val();
    
                    $('#logingwindow').jqxWindow('close');
                    //ShowLoadingWindow('Validating User', true);
    
                    $.ajax({
                        type: 'POST',
                        dataType: 'json',
                        contentType: 'application/json',
                        url: 'Main.aspx/ValidateUser',
                        data: JSON.stringify({ "name": userName, "password": password }),
                        success:
                            function(response) {
                                var obj = JSON.parse(response.d);
                                if (!obj.validUserName) {
                                    //ShowLoadingWindow('Validating User', false);
                                    $('#lblError').text("     Invalid User Name");
                                    $('#logingwindow').jqxWindow('show');
    
                                }
                                else if (obj.validUserName && !obj.validPassword) {
                                    //ShowLoadingWindow('Validating User', false);
                                    $('#lblError').text("     Invalid Password");
                                    $('#logingwindow').jqxWindow('show');
    
                                }
                                else if (obj.validUserName && obj.validPassword) {
                                    $('#logingwindow').jqxWindow('close');
                                    $('#logingwindow').remove();
                                    //ShowLoadingWindow('Loading User Data', true);
                                    if (obj.isAdmin)
                                        LoadUserHomeBar(true);
                                    else
                                        LoadUserHomeBar(false);
                                    LoadStatus();
                                    LoadUserTask();
    
                                    //ShowLoadingWindow('Loading User Data', false);
                                }
                            },
                        error:
                            function(jqXHR, textStatus, errorThrown) {
                                $('#logingwindow').jqxWindow('close');
                                ShowError(jqXHR, textStatus, errorThrown);
                            }
                    });
                }
            });
            $('#logingwindow').jqxWindow('show');
        }
        else {
            $('#logingwindow').jqxWindow('close');
            $("#logingwindow").remove();
        }
    }
    Jqwidgets in IE when published #55254

    Dimitar
    Participant

    Hello crooseat,

    Please make sure you have referenced every needed JavaScript file in your page, such as jqxinput.js, jqxbuttons.js, jqxwindow.js, etc.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.