Wow, Robert, your help has saved me so much time! I had to tweak the code a bit to get it to work in my WMA, but now it is doing exactly what I wanted!
Users have the option to enter their default information in the text boxes in the left pane, and click OK:
Here is the code for the function that runs when the OK button is clicked:
function clickBtnSetDefaultInfo() {
var inname = txt1.value;
var incomm = txt2.value;
var inemail = txt3.value;
var inphone = txt4.value;
// Set auto population of commenter fields
theEditor.settings.editor.templatePicker.on("selection-change", lng.hitch(this, function() {
var selected = theEditor.settings.editor.templatePicker.getSelected();
if (selected) {
fLayerPt.on("before-apply-edits", lng.hitch(this, function(evt){
if(evt.adds && evt.adds.length > 0){
if(evt.adds[0].attributes.hasOwnProperty('CommenterName')){ evt.adds[0].attributes.CommenterName = inname; }
if(evt.adds[0].attributes.hasOwnProperty('CommenterComm')){ evt.adds[0].attributes.CommenterComm = incomm; }
if(evt.adds[0].attributes.hasOwnProperty('CommenterEmail')){ evt.adds[0].attributes.CommenterEmail = inemail; }
if(evt.adds[0].attributes.hasOwnProperty('CommenterPhone')){ evt.adds[0].attributes.CommenterPhone = inphone; }
theEditor.settings.editor.attributeInspector.refresh();
}
}));
}
}));
}
And then here is the popup when the user adds a new point:
The Clear button will run a similar function to the OK button, it sets the text box values and the default values to "".
Thanks again!