quote:
Originally posted by SpunkyLoveMuff
unlikely... It should use a file in the local folder...
Which is the My Documents folder and i found that very unlikely to put an XML file...
Btw, if you want to close the window after saving the file (when it works) remove break;
code:
function OnWndMainEvent_CtrlClicked(Wnd, Handling)
{
switch(Handling)
{
case "knap_tilfoej":
var Navn = Wnd.GetControlText("input_navn");
var Modtaget = Wnd.GetControlText("input_modtaget");
var Svar = Wnd.GetControlText("input_svar");
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.load("indstillinger.xml");
var toAdd = xml.createElement("Navn");
toAdd.appendChild(xml.createTextNode(Navn));
xml.getElementsByTagName("Navn")[0].appendChild(toAdd);
xml.save("indstillinger.xml");
// Removed the break; here
case "knap_luk":
Wnd.Close(1);
break;
}
}