locked
Button Event Handler Not Firing

    Question

  • FIXED: I'm not sure exactly what happened. I restarted Visual Studio and it's working now.       

    Hi. I'm trying to get a button to work in my app, but I can't get the handler function to fire. I've debugged to make sure the listener is actually being added and it is. Additionally, adding the onclick="handler" in the markup immediately crashes the application with no error dialogue when the button is clicked. 

    I'm using the Page Control Template and the button is in a <td> element if that matters at all. 

    I've included the ready: portion of the .js file. It's the only part of the .js that has been altered. 

    ready: function (element, options) {
                // TODO: Initialize the page here.
    
                //add event handlers
    
                function editAppInfo(eventInfo) {
    
               //breakpoint here to see if handler is firing
    
                    var debug = 0;
                }
                //add event listeners
                var editButton = document.getElementById("button10");
                editButton.addEventListener("click", editAppInfo, false);
    
            },


                
    • Edited by TR1320 Saturday, January 18, 2014 12:17 AM Solved
    Saturday, January 18, 2014 12:04 AM

Answers

  • Thanks for updating. To summarize: fixed by restarting VS.

    In the future you might want to reply to your post so it can be marked answered rather than editing the post.

    --Rob

    Saturday, January 18, 2014 12:32 AM
    Owner