javascript - Onclick Image open/popup file field -


i have file field in form. field looks odd. want make image. click on image , opens file field(choose file).

give me best solution. browsers support.

this should :

html code

<label class="filebutton"> browse file! <span><input type="file" id="myfile" name="myfile"></span> </label> 

css styles

label.filebutton {     width:120px;     height:40px;     overflow:hidden;     position:relative;     background-color:#ccc; }  label span input {     z-index: 999;     line-height: 0;     font-size: 50px;     position: absolute;     top: -2px;     left: -700px;     opacity: 0;     filter: alpha(opacity = 0);     -ms-filter: "alpha(opacity=0)";     cursor: pointer;     _cursor: hand;     margin: 0;     padding:0; } 

Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -