Javascript and MS Edge behaviour

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Purple
    Recognized Expert Contributor
    • May 2007
    • 404

    Javascript and MS Edge behaviour

    I have the following Javascript function to manage the edit of a field on a bootstrap modal web page. It works fine with Chrome but Edge does a page reload after completion which closes the modal.

    Any thoughts on why this is happening? Suggestions to stop it?
    Code:
    function edit(element) {
        if (document.getElementById(element + "-glyph").className == "glyphicon glyphicon-pencil") {
            document.getElementById(element).readOnly = false;
            document.getElementById(element + "-glyph-remove").style.visibility = "visible";
            document.getElementById(element + "-can").style.visibility = "visible";
            document.getElementById(element + "-glyph").className = "glyphicon glyphicon-ok";
            document.getElementById(element + "-glyph").title = "save?";
            document.getElementById(element).focus();
            return true;
        }
    }
  • Purple
    Recognized Expert Contributor
    • May 2007
    • 404

    #2
    Ok - update, I found the issue..

    There was an issue with my handling of a button in the HTML.

    I had set the type to submit rather than button..

    Comment

    Working...