Hi Henny,
Not sure I understand your question. You have a form and you want to display dialog boxes that prompt the user for information. After they submit and click "OK" on the dialog box, you'd like to have it fill in the InfoPath form with the information. Is that correct?
Why not just use a separate view in InfoPath for this? The benefits are: no code, better validation, and consistent user experience (all in the same form). Just have them click on a button and then you can either switch to the new view or just show a hidden section in the existing view. After they fill out the fields, the form could switch back to the original view or hide the section.
Good luck!
Patrick Halstead
Project Manager at Qdabra