Generic function for handling forms

The data of the submitted forms aren't saved to the DB. It's for a later
commit.