Open form with button please help me !

C

Cyril

First of all I am using Infopath SP1.
I have a form with a dropdownlist polulated with the names of some other
infopath for m( ex: 1.xml, 2.xml, 3.xml etc...)

I would like to make a selection in the dropdownlist, like 2.xml, then click
on a button and have the selected form open in Infopath.

I am sure this is possible using some king of scripting but I have no idea
how to do it. can someone post the code that would help me do this?

Thanks a lot

Cyril
 
R

Rick Severson [MSFT]

Hi Cyril,

Try using something like this in the button's event handler:

function CTRL1_5::OnClick(eventObj)
{
var FormToOpen = XDocument.DOM.selectSingleNode("//my:field1");
Application.XDocuments.NewFromSolution(FormToOpen.text);
}

Note that my:field1 is the field that the drop down is bound to. For the
FormToOpen.text values, these may need to be escaped for file paths and or
url's.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top