Using this article, I'm changing the styling of some of my HTML5 form-validation pop-ups. However, my error pop-ups still have the default, orange exclamation point in the error, in addition to the new red X I've added. How do I get rid of the orange exclamation point (see image below). So far, I'm only testing in Chrome.
Here is the CSS that I'm using from that article:
::-webkit-validation-bubble-message
{
color: #eee;
background: #000;
border-color: #444;
-webkit-box-shadow: 4px 4px 4px rgba(100,100,100,0.5);
}
::-webkit-validation-bubble-message:before {
content: "";
display: inline-block;
width: 16px;
height: 16px;
margin-right: 4px;
background: url(/myPath/myImage.png)
}
::-webkit-validation-bubble-arrow {
background: #000;
border-color: #444;
-webkit-box-shadow: 0 0 0 0;
}
To ignore HTML validation, you can remove the attribute on button click using JavaScript. Uer removeAttribute() to remove an attribute from each of the matched elements.
Replacing the Default HTML5 Validation MessageBegin by adding an id to the input element, so as to be able to select it conveniently. var input = document. getElementById( 'username' ); Lastly, we specify the message used when the input shows its invalid state.
Validation-related attributesThe value must be greater than or equal to the value. There must be a value (if set). Unless the step is set to the any literal, the value must be min + an integral multiple of the step. The number of characters (code points) must not be less than the value of the attribute, if non-empty.
Try:
input::-webkit-validation-bubble-icon {
display: none;
}
or, of course:
input::-webkit-validation-bubble-icon {
background: url(http://google.com/favicon.ico);
}
Jsfiddle here: http://jsfiddle.net/xhqhV/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With