Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

How to image button use for file or image upload in click image button, using c# asp.net or jquery?

Please help me.

Thanks in Advance.

Ankit Agarwal
Website Developer
Posted

1 solution

XML
<body>
    <label>File</lable>
    <input type="image" src="http://upload.wikimedia.org/wikipedia/commons/c/ca/Button-Lightblue.svg" width="30px"/>
    <input type="file" id="my_file" style="display: none;" />
</body>


JavaScript
$("input[type='image']").click(function() {
    $("input[id='my_file']").click();
});


Fiddle Demo[^]

Hope this may help.
 
Share this answer
 
v2
Comments
[no name] 14-Jan-14 4:39am    
How can we display display, after selected image on clicked image?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900