HTML input fields does not get focus when clicked

后端 未结 27 2024
予麋鹿
予麋鹿 2020-12-08 06:11

I have a problem and I can\'t figure out what exactly is causing this behavior. I cannot access my input fields and textareas on my HTML form.

Unfortun

相关标签:
27条回答
  • 2020-12-08 06:41

    I had this problem because of this code:

    $("#table tbody tr td:first-child").bind("mousedown", function(e){
        e.preventDefault();
        $(this).parents('tr').removeClass('draggable');
    });
    

    I resolved it by removing

    e.preventDefault();

    New code:

    $("#table tbody tr td:first-child").bind("mousedown", function(){
        $(this).parents('tr').removeClass('draggable');
    });
    
    0 讨论(0)
  • 2020-12-08 06:42

    This happens sometimes when there are unbalanced <label> tags in the form.

    0 讨论(0)
  • 2020-12-08 06:43

    I had this problem too, and in my case I found that the color of the font was the same color of the background, so it looked like nothing happened.

    0 讨论(0)
  • 2020-12-08 06:46

    I had this issue caused by a sort of overlap of a div element with a bootstrap class ="row" over a "brother" div element with the class="col", the first hid the focus of the second div element.

    I solved taking outer the div row element from that level of the divs' tree and so rebalancing bootstrap logical hierarchy based on the row and col classes.

    0 讨论(0)
  • 2020-12-08 06:47

    I had the same problem. Tore my hair for hours trying all sorts of solutions. Turned out to be an unclosed a tag.Try validate your HTML code, solution could be an unclosed tag causing issues

    0 讨论(0)
  • 2020-12-08 06:48

    I just found another possible reason for this issue, some input textboxes were missing the closing "/", so i had <input ...> when the correct form is <input ... />. That fixed it for me.

    0 讨论(0)
提交回复
热议问题