Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Auto tab works on one computer but not on another

I'm using JQuery auto-tab with this JQuery library

<script language="javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script>


On my machine, the auto tab works. I'm using IE 9. Works in firefox as well. Another worker has the same IE and the autotab doesnt work for her. Works for some users, doesnt work for others. How can I debug this? someone said to use 1.7.1 version of JQuery but the entire site then needs to be retested and we're close to going Live.

Any ideas?

This is the code just in case i need to change something here:

<script type="text/javascript">
    jQuery.fn.autotabindex = function () {
        var keypressed = null;
        jQuery(this).click(function () {
            $(this).select();
        });
        jQuery(this).keyup(function (e) {
            if (window.event) keycode = window.event.keyCode;
            else if (e) keycode = e.which;
            keypressed = keycode;
            switch (keypressed) {
                // ignore the following keys     
                case 9: // tab
                    return false;
                case 16: // shift
                    return false;
                case 20: // capslock
                    return false;
                default: // any other keyup actions will trigger
                    var maxlength = jQuery(this).attr('maxlength'); // get maxlength value
                    var inputlength = jQuery(this).val().length; // get the length of the text
                    if (inputlength >= maxlength) { // if the text is equal of more than the max length
                        next = parseInt($(this).attr("tabindex")) + 1;
                        end = next + 5;
                        for (next; next < end; next++) {

                            if ($("[tabindex='" + next + "']").is(':visible')) {
                                $("[tabindex='" + next + "']").select();
                                $("[tabindex='" + next + "']").focus();
                                break
                            }
                        }
                    }
            }
        });
    }
</script>
<script type="text/javascript">
    $(document).ready(function () {
        $('.autotabindex').autotabindex();
    });
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Camillia

ASKER

>> Have you looked at the browsers that don't work and ensure that scripting is allowed
where do I check this?
Did you find an answer to your last question?
I didn't sorry. I will google for it. If you know, please let me know.
thanks, let me try
hmmm..it was on ..the javascript stuff...but still no autotab. Maybe i need to try 1.7 version
What version of browser is causing problems?
Never mind, the user forgot to restart IE. It works now. Thanks for your help.