1
I am doing a project in Asp.net MVC 5, and I need the text of my input type 'file' to change to the name of the file when loading it.
I hid the input to be triggered by clicking on label
in CSS as below:
HTML:
<div class="form-group">
<label for="fupload" class="control-label label-bordered">Clique aqui para escolher um arquivo</label>
<input type="file" id="fupload" name="fupload" class="fupload form-control" />
</div>
CSS:
input[type="file"] {
display: none;
}
.label-bordered {
border: 1px solid #cecece;
padding: 10px;
border-radius: 5px;
}
Stayed like this:
Someone can give me a light?
Very good! I did so: var filename = $('#fupload'). val(). split(' '). pop(); $('#label-fupload'). text("'" + filename + "' loaded and ready to upload!");
– Csorgo
Good, I would post something like this but I thought... let his logic work hehehehe
– Hiago Souza
hahaha Thanks for that! Sometimes we just need a 'little push''.
– Csorgo