java - How to delete the uploaded file -
i have got task upload file.there remove button file.if want remove,we can press remove button.for used code
the code is
<div id="main"> <p id="addfile1">add file</p> <div id="file1"> <input type="file"/> <input type="image" src="http://farm8.staticflickr.com/7153/6852073179_00961ba267.jpg" width="20px" id="btnclose1"/> </div> <p id="addfile2">add file</p> <div id="file2"> <input type="file"/> <input type="image" src="http://farm8.staticflickr.com/7153/6852073179_00961ba267.jpg" width="20px" id="btnclose2"/> </div> <p id="addfile3">add file</p> <div id="file3"> <input type="file"/> <input type="image" src="http://farm8.staticflickr.com/7153/6852073179_00961ba267.jpg" width="20px" id="btnclose3"/> </div> </div> js
$("#file").hide(); $("#btnclose").hide(); $("#addfile").click(function() { $("#file").show(); $("#btnclose").show(); $("#addfile").hide(); }); }); [i want display file tag clicking addfile.when select record want show remove button addfile must hidden]
to deselect file have clear value of input
$('input[type="image"]').click(function(){ $(this).parent().find('input[type="file"]').val(''); }); where $('input[type="image"]') cancel image , ('input[type="file"]') if file input
Comments
Post a Comment