How to rename the browse button as "Select the file"? E.g.:
<input type=file name=browse >
call( inputs, function( input ) { var label = input. nextElementSibling, labelVal = label. innerHTML; input. addEventListener( 'change', function( e ) { var fileName = ''; if( this.
you cannot directly customize the browse button. your CSS won't work upon it. What you can do is, you can create a button of yours with a textbox to the left of it. customize it, and upon click, trigger the original file upload.
Definition and Usage. The <input type="file"> defines a file-select field and a "Browse" button for file uploads. To define a file-select field that allows multiple files to be selected, add the multiple attribute. Tip: Always add the <label> tag for best accessibility practices!
<script language="JavaScript" type="text/javascript"> function HandleBrowseClick() { var fileinput = document.getElementById("browse"); fileinput.click(); } function Handlechange() { var fileinput = document.getElementById("browse"); var textinput = document.getElementById("filename"); textinput.value = fileinput.value; } </script> <input type="file" id="browse" name="fileupload" style="display: none" onChange="Handlechange();"/> <input type="text" id="filename" readonly="true"/> <input type="button" value="Click to select file" id="fakeBrowse" onclick="HandleBrowseClick();"/>
http://jsfiddle.net/J8ekg/
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