Delete the "Clear Field" X button of IE10 on some inputs?

This article was translated from: Remove IE10's “clear field” X button on certain inputs?

It's a useful feature, to be sure, but is there any way to disable it? This is a useful feature, but is there a way to disable it? For instance, if the form is a single text field and already has a "clear" button beside it, it's superfluous to also have the X. In this situation, it would be better to remove it. For example, if the form is a single text field And there is already a "clear" button next to it, then there is also an extra X. In this case, it would be better to delete it.

Can it be done, and if so, how? Can it be done, and if so, how ?


#1st Floor

Reference: https://stackoom.com/question/wm1v/ Delete IE--clear field-X button on some inputs


#2nd Floor

Style the ::-ms-clearpseudo-element for the box: Set the style of the pseudo-element for the box :::-ms-clear

.someinput::-ms-clear {
    display: none;
}

#3rd floor

I'm of Better to found the I at The the SET widthand heightto 0px. I found the best will widthand heightset 0px. The Otherwise, IE10 ignores option at The padding defined at The Field, ON - padding-right- Which WAS to the Keep at The Intended over at The Typing text from 'the X-' icon that the I overlayed the INPUT at The Field, ON. Otherwise, IE10 will fill the fields defined on ignoring - padding-right- This is to prevent text from typing on the "X" icon that I overlaid on the input field. IE10 IS'm Guessing that the I Applying at The internally padding-rightof the INPUT to at The at The ::--ms-clearpseudo Element, and at The pseudo Element Hiding does not Restore at The padding-rightvalue to at The input. I guess IE10 inside the input padding-rightused in ::--ms-clearpseudo-elements and pseudo-elements will not hide padding-rightRestore the value to input.

This worked better for me: This worked better for me :

.someinput::-ms-clear {
  width : 0;
  height: 0;
}

#4th floor

I would apply this rule to all input fields of type text, so it doesn't need to be duplicated later: I will apply this rule to all input fields of text type, so there is no need to copy it later:

input[type=text]::-ms-clear { display: none; }

One can even get less specific by using just: By using the following, you can even reduce specificity:

::-ms-clear { display: none; }

I have used the later even before adding this answer, but thought that most people would prefer to be more specific than that. I used the latter before adding this answer, but think most people want to be more specific than this. Both solutions work fine. Both solutions work fine .


#5th Floor

Should style for by You ::-ms-clear( http://msdn.microsoft.com/en-us/library/windows/apps/hh465740.aspx ): You should ::-ms-clearstyle ( http://msdn.microsoft.com/en-us/library /windows/apps/hh465740.aspx ):

::-ms-clear {
   display: none;
}

And you also style for ::-ms-revealpseudo-element for password field: You also set the style of the pseudo-element for the password field :::-ms-reveal

::-ms-reveal {
   display: none;
}

#6th floor

I think it's worth noting that all the style and CSS based solutions don't work when a page is running in compatibility mode. I think it's worth noting that when the page is running in compatibility mode , all the solutions based on style and CSS Nothing works. The compatibility mode renderer ignores the ::-ms-clear element, even though the browser shows the x. Even if the browser displays x, the compatibility mode renderer ignores the ::-ms-clear element.

If your page needs to run in compatibility mode, you may be stuck with the X showing. If your page needs to run in compatibility mode, you may encounter the X display.

In my case, I am working with some third party data bound controls, and our solution was to handle the "onchange" event and clear the backing store if the field is cleared with the x button. In my case, I am using For some third-party data-bound controls, our solution is to handle the "onchange" event and clear the backing store, if you use the x button to clear the field.

Published 0 original articles · praised 8 · 30,000+ views

Guess you like

Origin blog.csdn.net/asdfgh0077/article/details/105468913