Faryal Imam Faryal Imam - 9 months ago 35
Javascript Question

how to clear fileupload text box inside a modal popup window in asp.net?

If user has selected the file but did not upload and hid the popup, the selected file should disappear (in other words fileupload textbox should be again showing "No File selected" )

$('#modal1').on('hidden.bs.modal', function (e) {
var fu = document.getElementById("fileupload1");
if (fu != null) {
document.getElementById("fileupload1").outerHTML = fu.outerHTML;

this code isnt working


This one worked for me.

$(document).on('hidden.bs.modal', '#modalPopup1', function (event) {