Faryal Imam Faryal Imam - 1 year ago 74
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

Answer Source

This one worked for me.

$(document).on('hidden.bs.modal', '#modalPopup1', function (event) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download