javascript - open the file upload dialogue box onclick the image -


i want open image upload file dialogue box if click button tag.is possible.if how can in php

while{     echo "<td><button><img src='".$cfet['productimage']."' width='50' height='40'></button></td>"; } 

include input type="file" element on html page , on click event of button trigger click event of input type file element using trigger function of jquery

the code like:

<input type="file" id="imgupload" style="display:none"/>  <button id="openimgupload">image upload</button> 

and on button's click event write jquery code :

$('#openimgupload').click(function(){ $('#imgupload').trigger('click'); }); 

this open file upload dialog box on button click event..


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -