Why won't my features populate to my form?

3706
1
05-15-2015 02:12 PM
ChrisSergent
Regular Contributor III

I populate my form based on a map click event which had been working, but no longer is. I have uploaded the current code on Github at: csergent45/streetSigns · GitHub

If you would like to see how to re-create the error that I am running into, I have a screen recording explaining how:

The error that I receive is: Uncaught TypeError: Cannot read property 'defaultPrevented' of undefined from: http://rawgit.com/xsokev/Dojo-Bootstrap/master/Modal.js

The code that populates or should populate my for input boxes is the following:

 /* Get support information on click */
        var supportId, type, address;
        app.supportLayer.on("click", function (evt) {


            // declare rest endpoint values
            supportId = evt.graphic.attributes.SUPPORTID;
            type = evt.graphic.attributes.TYPE;
            address = evt.graphic.attributes.ADDRESS;


            app.attributesModal.modal("show");


            document.getElementById("supportForm").reset();


            /* Enter your domain item and then the element to populate */
            populateSelect("TYPE", "type", "support");
            populateSelect("SIZE_", "size", "support");
            populateSelect("MATERIAL", "material", "support");
            populateSelect("BASE", "base", "support");
            populateSelect("RATING", "rating", "support");


            // Show supports form for updating 
            app.attributesModal.modal("show");


            document.getElementById("address").value = address;
            document.getElementById("supportId").value = supportId;
            document.getElementById("type").value = type;
            console.log(supportId);
            console.log(type);
            console.log(address);
        });
0 Kudos
1 Reply
ChrisSergent
Regular Contributor III

I needed to populate the form before I opened it. Issue solved.

document.getElementById("address").value = address;
            document.getElementById("supportId").value = supportId;
            document.getElementById("type").value = type;
            console.log(supportId);
            console.log(type);
            console.log(address);


            // Show supports form for updating
            app.attributesModal.modal("show");