Spawn/Delete Functionality to an App.Alert
I'm using a bit of complex code (and I'm trying to stay away from global variables) to have a checkbox within an app.alert window that upon click wound spawn a template. I have both codes (one for the app.alert with checkbox, and one for the spawn/delete) but cannot seem to link the two together well. Any help would be greatly appreciated.
App.Alert Code [Based on a dropdown value] :
{var oCk = {cMsg:"Yes, I want to add a form to this document", bInitialValue:true, bAfterValue:false};
app.alert({cMsg:" Do you want to add a form to this document?", nIcon:3, oCheckbox:oCk, cTitle:"TDR?"});
}
Spawn/Delete Code [To be triggered upon click of app.alert check]:
if (this.getField("Checkbox").value == "Off")
{
oFld = this.getField("Additional NotesComments");
this.deletePages(oFld.page[1]);
}
else
{
var a = this.getTemplate("Form");
a.spawn(1, false, false);
}
Let me know if you can help!
