1

I have a site that pulls up a modal with data. It validates the modal and then closes the modal. This is the close function:

function closeModal() {
    console.log("Close Modal button clicked");
    console.log("Simulate buttonclick on " + '<%=btnSave.ClientID%>');
    try
    {
        $('#<%=btnSave.ClientID%>').click();
    }
    catch(err)
    {
         console.log("btnSave.click error: " + err);
    }
    return true;
}

The .click calls a button which calls an ASP function to post the data to the database. This works fine in Chrome and Firefox but it is not working in IE 11.

Here is IE's console:

IE Console Log

This is the same as what Chrome puts out in the log as well. However, the save is called and succeeds with Chrome and Firefox but not with IE.

Scott Craig
  • 275
  • 2
  • 10

2 Answers2

2

It seems, IE 11 has some restrictions in terms of support DOM Level 2 HTMLElement.click(). Please take a look at the following answer. It can be helpful for you.

Community
  • 1
  • 1
Alex M
  • 2,756
  • 7
  • 29
  • 35
0

Try using jQuery to close your modal.

//Get a reference to your modal and hide it
$('#deleteModal').modal('hide');

<div class="modal fade" tabindex="-1" role="dialog" id="deleteModal">
    <div class="modal-dialog">
        <div class="modal-content">
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
Mitch Stewart
  • 1,253
  • 10
  • 12
  • That is how it is done. The modal closes successfully, but the Save function above doesn't run the ASP procedure as it should based off the Click function. – Scott Craig Jul 06 '16 at 15:15