swiss_blade
swiss_blade

Reputation: 541

HTML input tag, cannot type

I have been struggling with this for a couple of days. I am pretty sure it's something simple, but I just can't see it. On this page there is a form that users can use to send a message. Click on the grey Contact icon to see it. The form used to work fine, but now I cannot type into any fields. Selecting an autocomplete value works though. I have tried disabling some Javascript, adding a z-index value to the fields, but to no avail. Can someone please take a look and tell me what might be the problem?

Thanks in advance.

Upvotes: 0

Views: 304

Answers (1)

Jordumus
Jordumus

Reputation: 2783

You are too eager to restrict the user..

This code is the problem:

$(document).keydown(function(e){
    if (e.keyCode == 39) {          
        //(...)
        toggleArrows();
    }
            return false;
});

If the button IS NOT keyCode 39, you deny the button functionality. Just remove the return false and your problem will be gone.

Edit: I just noticed you have 2 keydown events, one checking for keycode 37 and one for 39. Don't do that! You should do it this way:

$(document).keydown(function(e){
    if (e.keyCode == 39) {          
        //(...)
    }
    else if (e.keyCode == 37) {
       //(...)
    }

});

And, again, get rid of the return false;.

JSFiddle to show the result: http://jsfiddle.net/xr2stb0k/ First checkbox is restricted with return false (except for the letter "a"), second one isn't.

Upvotes: 1

Related Questions