1

I have a text input that i want to hide it's blinking cursor.

I found a solution (setting color to transparent) that working fine in FireFox and Chrome but this solution didn't work in IE.

Is there a solution for this?

<input type="text" value="dummydummydummy" tabindex="-1" id='test' style="cursor: none;color: transparent; width: 0px; height: 0px; background-color:transparent; border:solid transparent 1px; outline: none; position: absolute; z-index: 2000"/>

Also I don't want to blur the control immediately after input gets focus. because I need the control to be focused.

note : I am testing this in IE8

farid bekran
  • 2,684
  • 2
  • 16
  • 29

1 Answers1

0

You can put a button to make that textfield focusable (with blink) or not.

With JQuery:

$('#test').on("focus",blurMe);
var focusable = false;

function blurMe(){
    $(this).blur();
}

$('#swapper').click(function(){
    if(focusable){
        $('#test').on("focus",blurMe);
        focusable = false;
    }else{
        $('#test').off("focus",blurMe);
        focusable = true;
    }   
});

And html :

<input type="text" value="dummydummydummy" tabindex="-1" id='test' style="cursor: none;color: transparent; width: 0px; height: 0px; background-color:transparent; border:solid transparent 1px; outline: none; position: absolute; z-index: 2000"/>
<input type="button" id="swapper">
SerCrAsH
  • 440
  • 5
  • 14