php - Bootstrap - Clear selected file using jquery - data-dismiss? -


so have div dedicated being image uploader. have div within show when file chosen. have <a> want rid of , clear out uploaded field using jquery.

does know how? .bind()'d click event <a> didn't work... (plus want rid of link together) believe it's because "active ingredient" data-dismiss="fileupload" part of <a>.

how can fire bad boy using code rather anchor tag?

here's code:

<div id="fileuploader" class="fileupload fileupload-new" data-provides="fileupload">     <div class="fileupload-new thumbnail" style="max-height: 215px; max-width: 175px;">         <img src="http://www.placehold.it/175x215/efefef/aaaaaa&text=no+image" />     </div>     <div class="fileupload-preview fileupload-exists thumbnail" style="max-height: 215px; max-width: 175px; line-height: 20px;">      </div>     <div>         <span class="btn btn-file">             <span class="fileupload-new">select image</span>             <span class="fileupload-exists">change</span>             <form>                 <input type="file" name="chosenfile" id="chosenfile"/>             </form>         </span>         <a href="#" id="remove" class="btn fileupload-exists" data-dismiss="fileupload">remove</a>     </div> </div> 

i'm not sure you're looking do, think want use click function this...

$('#remove').click(function(){     $('#chosenfile').val(''); }) 

here's demo


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -