Hi William,
> I'm need to access an XForms instance from my Javascript code. I see there
> are several approaches mentioned on this mailing list before:
>
> - Submission to a Javascript function
Sorry, only submission "from" a Javascript function (GET method) is
currently implemented in XSLTForms
> - xf:load with javascript:function on the resource attribute
> - onclick event on a plain HTML button
>
> For the last two, this code used to work for getting an instance as a
> Javascript Object:
>
> var model = window.document.getElementById("modelid");
> var doc = model.getInstanceDocument("instanceid")
>
> On the last updates of XSLTForms, this code doesn't work anymore.
Could you please send me a test case?
Mine works:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>Direct Access</title>
<xf:model id="modelid">
<xf:instance id="instanceid" xmlns="">
<data>dummy</data>
</xf:instance>
</xf:model>
<script type="text/javascript">
function directaccess() {
var model = window.document.getElementById("modelid");
var doc = model.getInstanceDocument("instanceid");
return doc.documentElement.textContent;
}
</script>
</head>
<body>
<xf:output value="directaccess()"/>
</body>
</html>
Thanks!
-Alain
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support