I'm working on a form with a <input type="file">
field. How do I change the default label 'Select File'?
See the image below:
I would like to change this default label to a custom one.
As far as I know, it's not possible to edit it, but there are a couple of alternatives.
Replace with label
.
input[type="file"] {
display: none;
}
.btnPerson {
padding: 10px;
line-height: 50px;
text-align: center;
background-color: gray;
}
<label for="teste" class="btnPerson">Escolha um arquivo</label>
<input type="file" id="teste">
However, the result of the image name can only be done through javascript.
Another alternative is to use a ready one, I've already used this one Input file tutorialzine , and recommend it.