I am using javascript to add a red glow using CSS box-shadow to form fields that are incorrectly filled. I am running into a problem with my file input field, in Firefox the glow extends around the browse button and I am also unable to remove the default border.
Is there a way to achieve this with CSS?
Thanks.
Here is an example -

HTML
<input type='file' id='userfile' name='userfile' maxlength='80' class='form-input'/>
CSS class being assigned
.field-error { -webkit-box-shadow: 1px 1px 5px 5px #ff0000; -moz-box-shadow: 1px 1px 5px 5px #ff0000; box-shadow: 1px 1px 5px 5px #ff0000; border: none; }
As far as I know the "Browse" button is completely inaccessible to CSS manipulation. You need some tricks to overcome this issue. I recommend you take a look at this article:
Or use jQuery alternative:
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