Nik Nik - 1 year ago 163
HTML Question

How to have a single button for upload file

Im trying to have a single upload file button without the choose file or submit buttons. I posted the image of my upload file button and the HTML and was wondering if anyone could point me in the right direction. Thanks

<a href="#" class="btn btn-info btn-sm remove">
<span class="glyphicon glyphicon-upload"></span> Upload File

enter image description here

Answer Source

why don't you hide your <input type="file" id="file"> and show only your image button, when someone click your button use this code:


<input type="file" id="file" style="display:none;" />
<button id="button" name="button" value="Upload" onclick="thisFileUpload();">Upload</button>


        function thisFileUpload() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download