You would build a regular frontend widget to accomplish this. Then use the API
to get the filled out data into the dynamic module. At least this is how I solved a similar requirement. Each custom module should also have generated one or more frontend widgets automatically, but I have never used those. I think they're only for reading data, not writing.