Refresh after submit

N

NikV

Question: How do I refresh my InfoPath form after hitting the Submit button
that saves the data to a database.

I have a drop down list that controls the flow of all the data in my form.
If a user picks something from the drop down list it will populate the other
text boxes with data from an XML File.

What I want to do is clear the drop down list so that it forces the user to
choose a new item ddl. This way it can refresh the data. How can I do this
within the Submit button? Thanks in Advance.
 
F

Franck Dauché

Hi,

An easy way is to create a "reset" function in your code that you can call
after your current data is saved. In that function, you can target the node
linked to your drop-down, and you can set the value by code to be "" (if it
is your default value).
thisXDocument.DOM.selectSingleNode(node path).text = "";

This works OK if you are just trying to reset a few specific nodes.

Hope that helps.

Franck Dauché
 
N

NikV

Frank;
I'm pretty new at this InfoPath stuff so please walk me through to do a
reset. Can you show me the steps? Thanks!
 
F

Franck Dauché

I am assuming a IP project with C# code behind. You added a button to
perform your "Save" function. After that "Save call" just add:
resetMyControls();

At the bottom of your FormCode.cs, add:
private void resetMyControls()
{
thisXDocument.DOM.selectSingleNode(node path).text = "";
//where -node path- = "/my:rootName/my:......./my:finalNodeName"
//add here any other nodes that you need to reset
}

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