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); });
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");