Hi,
Add OnContextChange event to the form and write the code to empty the field if the event is address field.
Ex:
[InfoPathEventHandler(EventType = InfoPathEventType.OnContextChange)]
public void FormEvents_OnContextChange(DocContextChangeEvent e)
{
if (e.Context.nodeName == "my:field8")
{ thisXDocument.DOM.selectSingleNode("/my:myFields/my:field8").text = "";
}
if (e.Type == "ContextNode")
{
// The XML selection or context has changed.
// Write your code here.
return;
}
}
Here my:field8 -> Address field
/my:myFields/my:field8 ----> is the xpath of the Address field.