This is functionality provided by using xforms model, how you add this to the form can be done before the form is sent to the user (using
updateXFormsInstance via the Lotus Forms API) or live using a xforms:submission where the form calls a web service.
I believe there are some previous discussions if you search the forum about using xforms:submission.
hope the helps