Copy link to clipboard
Copied
Hi
I'm trying to get values of some specific form fields and then generate a XML file based on that data using JS actions when a user clicks a button. It's possible to get those values but I'm not sure how to generate that xml and provided to the user. Any help would be appreciated.
Copy link to clipboard
Copied
Hi,
Try this attached file and the action wizard included (not possible to save the xml file from the button).
Script:
var spans=this.getField("text1").richValue;
var str=util.spansToXML(spans);
this.createDataObject("theFile.xml",str);
var spans=util.xmlToSpans(str);
this.getField("text2").richValue=spans;
this.getField("text3").value=str;
this.exportDataObject("theFile.xml");
@+
Copy link to clipboard
Copied
Hi,
Try this attached file and the action wizard included (not possible to save the xml file from the button).
Script:
var spans=this.getField("text1").richValue;
var str=util.spansToXML(spans);
this.createDataObject("theFile.xml",str);
var spans=util.xmlToSpans(str);
this.getField("text2").richValue=spans;
this.getField("text3").value=str;
this.exportDataObject("theFile.xml");
@+
Copy link to clipboard
Copied
woow, thanks mate
Copy link to clipboard
Copied
is there anyway to export a file?
Copy link to clipboard
Copied
What do you mean?
If you use the action wizard you can export the xml file. This can also be made via a button if we write an application script.
@+

