New to infopath & several questions...

H

hlj2005

I am trying to create a very simple form which will have one text box and one
button. I have an XML file that I'm tying to the form. The user will type a
city name into the text box, then hit a button called Query. If the city name
is found in the XML, they will see a box that says VALID. If the city name is
not found, they will get a box that says NOT VALID. Sounds very simple but I
cannot figure out how to run the query when they press the button.

My second question is, assuming I get that part to work, how do I then
publish the form to my corporate intranet, which is on an NT Server? Do I
convert the form to HTML and load it along with the XML file in the same
folder?

Thanks for any help you can give me!
 
F

Franck Dauché

Hi,

One way to do this would be:

Create a new blank IP form.
Create just 1 textbox in the schema to enter the city name.
Add your xml doc (Form1.xml) with the list of city as a secondary DOM (Tool
/ Data Connection / Add / Receive data / xml file).

Then, put a Query button to loop through your secondary DOM by code to
compare the value in the textbox with the value stored in your XML:
IXMLDOMDocument2 secDOM = (IXMLDOMDocument2)thisXDocument.CreateDOM();
secDOM.validateOnParse = false;
secDOM.load("Form1.xml");
secDOM.setProperty("SelectionNamespaces",
"xmlns:ns1=\'http://schemas.microsoft.com/office/infopath/2003/myXSD/XXXXXXXXXX\'");
IXMLDOMNode oTemplateGrp =
secDOM.selectSingleNode("/ns1:myFields/ns1:field1");

Next, when your form is done, Publish it to a central location and make sure
that your user have InfoPath installed on their machine to use the form.

Hope that it helps.

Regards,

Franck Dauché
 

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