javascript - customize the file button for image upload -
this question has answer here:
- custom upload button 7 answers
i placed button upload image files.i want customize button, want add more 1 image file ,what logic achive.
<input type="file" />,this rendering choose button text saying `no files choosen` in same line.
is possible customize text "no files choosen
"below choose
button.meanwile wise keep camera image before no files choosen
text.
how perform improve site.
thanks
you can hide input placing div height:0px
, overwflow:hidden
. add button or other html element can style want. in onclick event input field using javascript or jquery , click it:
<div style="height:0px;overflow:hidden"> <input type="file" id="fileinput" name="fileinput" /> </div> <button type="button" onclick="choosefile();">choose file</button> <script> function choosefile() { $("#fileinput").click(); } </script>
now input hidden, can style button want, open file input on click.
if don't want use jquery replace script tag script tag:
<script> function choosefile() { document.getelementbyid("fileinput").click(); } </script>
Comments
Post a Comment